/* Instint production stylesheet. Generated by npm run build:styles. */
/* Source order is intentional: base, surface-specific components, then one final mobile/accessibility layer. */

/* ==========================================================================
   Core application and authentication
   Source: styles-src/01-core.css
   ========================================================================== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

body.dashboard-body {
  min-height: 100vh;
}

.dashboard-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 72px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 16px;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.sidebar-link,
.sidebar-bottom {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: transparent;
  color: #475569;
  font-size: 18px;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: #e8f0ff;
  color: #2563eb;
}

.sidebar-bottom {
  margin-top: auto;
}

/* Main */
.main-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 76px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0 28px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.content-shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

.content-area {
  flex: 1;
  padding: 28px;
  min-width: 0;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.content-header h1,
.assistant-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  color: #111827;
}

.content-header p,
.assistant-header p {
  margin: 6px 0 0 0;
  color: #6b7280;
  line-height: 1.5;
}

.filters-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.search-wrap input,
.filter-wrap select,
.panel-body input[type="text"],
.panel-body textarea,
.assistant-form textarea {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 14px 14px;
  font-size: 16px;
  background: #ffffff;
  color: #111827;
  outline: none;
}

.search-wrap input:focus,
.filter-wrap select:focus,
.panel-body input[type="text"]:focus,
.panel-body textarea:focus,
.assistant-form textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.panel-body textarea,
.assistant-form textarea {
  min-height: 120px;
  resize: vertical;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.primary-btn,
.secondary-btn,
.card-btn,
.icon-btn {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}

.primary-btn {
  background: #2563eb;
  color: #ffffff;
  padding: 12px 18px;
}

.primary-btn:hover {
  background: #1d4ed8;
}

.secondary-btn {
  background: #f3f4f6;
  color: #374151;
  padding: 12px 18px;
}

.secondary-btn:hover {
  background: #e5e7eb;
}

.icon-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  color: #6b7280;
}

.icon-btn:hover {
  background: #f3f4f6;
}

/* Knowledge cards */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.knowledge-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}

.inactive-entry {
  opacity: 0.7;
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.category-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 12px;
}

.status-active {
  background: #e7f6ef;
  color: #2f7a60;
}

.status-inactive {
  background: #fdecec;
  color: #c05656;
}

.cat-amenities {
  background: #e7f0ff;
  color: #2563eb;
}

.cat-services {
  background: #eef2ff;
  color: #4f46e5;
}

.cat-housekeeping {
  background: #f3f4f6;
  color: #374151;
}

.cat-parking {
  background: #eef4ff;
  color: #334e9a;
}

.cat-accessibility {
  background: #e8fbff;
  color: #0f766e;
}

.cat-policies {
  background: #fff4e6;
  color: #b45309;
}

.cat-default {
  background: #f3f4f6;
  color: #475569;
}

.card-title {
  margin: 0 0 10px 0;
  font-size: 18px;
  line-height: 1.3;
  color: #111827;
}

.card-content {
  margin: 0;
  color: #374151;
  font-size: 15px;
  line-height: 1.55;
  min-height: 74px;
}

.card-divider {
  height: 1px;
  background: #edf0f4;
  margin: 18px 0 14px 0;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.card-btn {
  padding: 9px 14px;
}

.edit-btn {
  background: #f8fafc;
  color: #2563eb;
  border: 1px solid #dbe5f1;
}

.edit-btn:hover {
  background: #edf4ff;
}

.delete-btn {
  background: #fff7f7;
  color: #dc2626;
  border: 1px solid #f3d1d1;
}

.delete-btn:hover {
  background: #feeaea;
}

/* Right editor panel */
.editor-panel {
  width: 360px;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
}

.panel-header {
  height: 76px;
  padding: 0 18px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.panel-body {
  padding: 18px;
  overflow-y: auto;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0;
  font-weight: 600;
  color: #374151;
}

.panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.panel-actions .primary-btn,
.panel-actions .secondary-btn {
  flex: 1;
}

.status-message {
  min-height: 22px;
  color: #2563eb;
  font-size: 14px;
  margin-top: 10px;
}

/* Switch */
.switch {
  position: relative;
  width: 50px;
  height: 28px;
  display: inline-block;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #d1d5db;
  border-radius: 999px;
  transition: 0.2s;
}

.slider:before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: #10b981;
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
}

/* Assistant page */
.assistant-page {
  padding: 28px;
}

.assistant-card {
  max-width: 900px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}

.assistant-form {
  margin-top: 22px;
}

.assistant-form .primary-btn {
  margin-top: 14px;
}

.assistant-answer {
  margin-top: 28px;
}

.assistant-answer h2 {
  margin: 0 0 12px 0;
  font-size: 20px;
}

.answer-box {
  background: #111827;
  color: #f9fafb;
  padding: 16px 18px;
  border-radius: 14px;
  min-height: 0;
  white-space: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.empty-state {
  background: #ffffff;
  border: 1px dashed #d1d5db;
  color: #6b7280;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}

/* Mobile */
@media (max-width: 1200px) {
  .knowledge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-panel {
    width: 320px;
  }
}

@media (max-width: 980px) {
  .content-shell {
    flex-direction: column;
  }

  .editor-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid #e5e7eb;
    display: none;
  }

  .editor-panel.open {
    display: block;
  }

  .knowledge-grid {
    grid-template-columns: 1fr;
  }

  .filters-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 64px;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 14px;
  }

  .sidebar-nav {
    flex-direction: row;
    margin-top: 0;
  }

  .sidebar-bottom {
    margin-top: 0;
  }

  .topbar {
    height: auto;
    padding: 18px 16px;
  }

  .content-area,
  .assistant-page {
    padding: 16px;
  }

  .content-header {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-actions {
    flex-direction: column;
  }

  .card-actions {
    flex-wrap: wrap;
  }
}
.answer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.answer-title {
  font-weight: 700;
  font-size: 14px;
  color: #9ca3af;
  text-transform: uppercase;
}

.answer-main {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.answer-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: #fff;
}

.detail-line {
  line-height: 1.4;
}

.answer-sources {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.source-item {
  font-size: 12px;
  color: #9ca3af; /* neutral gray */
}

.answer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.confidence-pill {
  flex-shrink: 0;
  background: #e7f6ef;
  color: #2f7a60;
  border: 1px solid #b7e4cf;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .answer-row {
    flex-direction: column;
  }
}

.feedback-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.feedback-question {
  font-size: 14px;
  font-weight: 700;
  color: #d1d5db;
  margin-bottom: 10px;
}

.feedback-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.feedback-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.feedback-btn.helpful {
  background: #e7f6ef;
  color: #2f7a60;
}

.feedback-btn.not-helpful {
  background: #fdecec;
  color: #c05656;
}

.feedback-status {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.18);
}

.feedback-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 18px rgba(17, 24, 39, 0.05);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;

  text-align: center;
}

.summary-card span {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-card strong {
  font-size: 34px;
  font-weight: 700;
  color: #111827;
}

.summary-card.danger strong {
  color: #dc2626;
}

.feedback-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feedback-topic-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}

.feedback-topic-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.feedback-topic-header h2 {
  margin: 4px 0 0 0;
  font-size: 22px;
  color: #111827;
}

.topic-label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topic-status {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.topic-status.good {
  background: #e7f6ef;
  color: #2f7a60;
}

.topic-status.needs-review {
  background: #fdecec;
  color: #c05656;
}

.feedback-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.feedback-metrics div {
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 14px;
  padding: 14px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
  gap: 4px;
}

.feedback-metrics span {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feedback-metrics strong {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.summary-card:hover,
.feedback-metrics div:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
  transition: all 0.15s ease;
}

.latest-feedback {
  background: #f9fafb;
  border: 1px solid #edf0f4;
  border-radius: 14px;
  padding: 14px;
}

.latest-feedback p {
  margin: 6px 0 14px 0;
  line-height: 1.5;
  color: #374151;
}

.feedback-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #6b7280;
  font-size: 13px;
}

.feedback-details {
  margin-top: 14px;
}

.feedback-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #2563eb;
}

.feedback-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.feedback-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.feedback-table th,
.feedback-table td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 10px;
  vertical-align: top;
}

.feedback-table th {
  background: #f8fafc;
  color: #374151;
  font-weight: 600;
}

@media (max-width: 900px) {
  .feedback-summary-grid,
  .feedback-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback-topic-header {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .feedback-summary-grid,
  .feedback-metrics {
    grid-template-columns: 1fr;
  }
}

.urgent-feedback {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15), 0 12px 30px rgba(220, 38, 38, 0.08);
}

.feedback-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.feedback-action {
  border: 1px solid #dbe3ea;
  background: #ffffff;
  color: #374151;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.feedback-action:hover {
  background: #f8fafc;
}

.feedback-action.create-entry {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.feedback-action.reviewed {
  background: #e7f6ef;
  color: #2f7a60;
  border-color: #b7e4cf;
}

.feedback-action.needs-update {
  background: #fff4e6;
  color: #b45309;
  border-color: #f5d59f;
}

.feedback-action.ignored {
  background: #f3f4f6;
  color: #6b7280;
}
.urgent-feedback {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15), 0 12px 30px rgba(220, 38, 38, 0.08);
}

.feedback-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.feedback-action {
  border: 1px solid #dbe3ea;
  background: #ffffff;
  color: #374151;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.feedback-action:hover {
  background: #f8fafc;
}

.feedback-action.create-entry {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.feedback-action.reviewed {
  background: #e7f6ef;
  color: #2f7a60;
  border-color: #b7e4cf;
}

.feedback-action.needs-update {
  background: #fff4e6;
  color: #b45309;
  border-color: #f5d59f;
}

.feedback-action.ignored {
  background: #f3f4f6;
  color: #6b7280;
}

.association-manager {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}

.association-manager h2 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.association-manager p {
  margin: 6px 0 14px 0;
  color: #6b7280;
  font-size: 14px;
}

.association-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.association-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  padding: 12px 14px;
}

.association-name {
  font-size: 14px;
  color: #374151;
}

.remove-association-btn {
  border: 1px solid #f3d1d1;
  background: #fff7f7;
  color: #dc2626;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.remove-association-btn:hover {
  background: #feeaea;
}

.login-body {
  min-height: 100vh;
  background: #f5f7fb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: 100%;
  max-width: 460px;
}

.login-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.08);
}

.login-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 18px;
}

.login-card h1 {
  margin: 0;
  font-size: 26px;
  color: #111827;
}

.login-card p {
  margin: 8px 0 22px 0;
  color: #6b7280;
  line-height: 1.5;
}

.login-input {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 14px;
  font-size: 20px;
  letter-spacing: 0.15em;
  margin-bottom: 16px;
  outline: none;
}

.login-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-status {
  margin-top: 14px;
  min-height: 22px;
  color: #dc2626;
  font-size: 14px;
}

.branch-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.branch-option {
  width: 100%;
  text-align: left;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
}

.branch-option:hover {
  background: #eef4ff;
  border-color: #2563eb;
}

.branch-option strong {
  display: block;
  font-size: 16px;
  color: #111827;
}

.branch-option span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: #6b7280;
}

.duplicate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 80;
}

.duplicate-overlay.open {
  display: flex;
}

.duplicate-modal {
  width: min(1200px, 100%);
  max-height: 92vh;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.duplicate-header {
  padding: 20px 22px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.duplicate-header h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
}

.duplicate-header p {
  margin: 6px 0 0 0;
  color: #6b7280;
}

.duplicate-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 360px;
  overflow: auto;
}

.duplicate-column {
  padding: 22px;
  border-right: 1px solid #e5e7eb;
}

.duplicate-column:last-child {
  border-right: none;
}

.duplicate-column h3 {
  margin: 6px 0 8px 0;
  color: #111827;
  font-size: 20px;
}

.duplicate-meta {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 12px;
}

.duplicate-score {
  display: inline-flex;
  background: #fff4e6;
  color: #b45309;
  border: 1px solid #f5d59f;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.duplicate-content {
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 14px;
  padding: 14px;
  color: #374151;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 360px;
  overflow: auto;
}

.duplicate-list {
  padding: 0 22px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.duplicate-match-btn {
  width: 100%;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.duplicate-match-btn strong {
  color: #111827;
  font-size: 14px;
}

.duplicate-match-btn span {
  color: #6b7280;
  font-size: 13px;
}

.duplicate-match-btn:hover,
.duplicate-match-btn.active {
  border-color: #2563eb;
  background: #eef4ff;
}

.duplicate-actions {
  padding: 18px 22px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 800px) {
  .duplicate-body {
    grid-template-columns: 1fr;
  }

  .duplicate-column {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .duplicate-actions {
    justify-content: stretch;
  }

  .duplicate-actions button {
    flex: 1;
  }
}

.draft-editor-panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 90;
}

.draft-editor-panel.open {
  display: flex;
}

.draft-editor-panel .panel-shell {
  width: min(920px, 100%);
  max-height: 92vh;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.draft-editor-panel .panel-header {
  padding: 20px 22px;
  border-bottom: 1px solid #e5e7eb;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

.draft-editor-panel .panel-header h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
}

.draft-editor-panel .panel-body {
  padding: 22px;
  overflow-y: visible;
}

.draft-editor-panel input[type="text"],
.draft-editor-panel textarea {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  background: #ffffff;
  color: #111827;
  margin-bottom: 16px;
  outline: none;
}

.draft-editor-panel textarea {
  height: 300px;
  min-height: 220px;
  max-height: 40vh;
  resize: vertical;
  line-height: 1.6;
  overflow-y: auto;
}

.draft-editor-panel .panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.approve-wide-btn {
  width: 100%;
  margin-top: 16px;
  background: #10b981;
}

.approve-wide-btn:hover {
  background: #059669;
}

@media (max-width: 800px) {
  .draft-editor-panel {
    padding: 12px;
  }

  .draft-editor-panel textarea {
    min-height: 260px;
  }

.draft-editor-panel .panel-actions {
  grid-template-columns: 1fr;
}
}

.improve-draft-btn {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

.improve-draft-btn:hover {
  background: #e0e7ff;
}

.improve-draft-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#aiImprovedContent {
  border-color: #c7d2fe;
  background: #f8f9ff;
}

#aiImproveOverlay .duplicate-modal {
  width: min(1100px, 100%);
}

#aiImproveOverlay {
  z-index: 120;
}

#duplicateOverlay {
  z-index: 110;
}

#draftEditorPanel {
  z-index: 90;
}

.draft-editor-panel.ai-review-active .panel-shell {
  filter: blur(1px);
  opacity: 0.65;
  pointer-events: none;
}
.merge-draft-btn {
  background: #10b981;
  color: #ffffff;
}

.merge-draft-btn:hover {
  background: #059669;
}

.import-drafts-list {
  margin-top: 0;
}

.import-draft-card {
  display: flex;
  flex-direction: column;
}

.import-draft-card .card-title {
  min-height: auto;
}

.import-draft-content {
  max-height: none;
  overflow: visible;
  white-space: pre-wrap;
  min-height: 110px;
}

.formatted-knowledge-content {
  white-space: normal;
  overflow-wrap: anywhere;
}

.formatted-content-line {
  display: block;
  margin: 0 0 0.42em;
  line-height: 1.55;
}

.formatted-content-spacer { min-height: 0.5em; margin: 0; }

.formatted-content-list-line {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.55em;
  align-items: start;
}

.formatted-content-marker {
  min-width: 1.35em;
  font-weight: 700;
  color: currentColor;
}

.formatted-knowledge-content mark {
  color: #251700;
  background: #ffe680;
  border-radius: 3px;
  padding: 0 0.12em;
}

.formatted-knowledge-content u { text-underline-offset: 0.16em; }

.formatted-source-callout {
  margin: 0.7em 0 1em;
  padding: 0.9em 1em;
  border: var(--knowledge-callout-border-width, 0) solid var(--knowledge-callout-border, transparent);
  border-radius: 10px;
  color: #202638;
  background: var(--knowledge-callout-background, transparent);
  box-shadow: 0 1px 2px rgba(28, 35, 55, 0.08);
}

.formatted-source-callout-dark { color: #ffffff; }

.formatted-source-callout > .formatted-content-line:last-child {
  margin-bottom: 0;
}

.formatted-source-callout mark {
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.import-skipped-details {
  margin-top: 16px;
  border: 1px solid #d5ddeb;
  border-radius: 14px;
  background: #ffffff;
}

.import-skipped-details summary {
  padding: 14px 16px;
  cursor: pointer;
  color: #25304a;
  font-weight: 700;
}

.import-skipped-list { display: grid; gap: 10px; padding: 0 16px 16px; }
.import-skipped-item { padding: 12px 14px; border: 1px solid #e0e6f0; border-radius: 12px; background: #f8faff; }
.import-skipped-item strong { display: block; color: #20283b; }
.import-skipped-item span { display: block; margin-top: 3px; color: #667085; font-size: 0.8rem; }
.import-skipped-item p { margin: 7px 0 0; color: #414b61; }

.import-analysis-details {
  margin-top: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
}

.import-analysis-details summary {
  padding: 14px 16px;
  cursor: pointer;
  color: #25304a;
  font-weight: 700;
}

.import-analysis-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.import-analysis-item {
  padding: 12px 14px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #f8fafc;
}

.import-analysis-item.verified {
  border-color: #a7d7c5;
  background: #f0fdf7;
}

.import-analysis-item.warning {
  border-color: #f4c7a2;
  background: #fff8f1;
}

.import-analysis-item strong,
.import-analysis-item span { display: block; }
.import-analysis-item strong { color: #172033; }
.import-analysis-item span { margin-top: 4px; color: #475569; }
.import-analysis-item p,
.import-analysis-item ul { margin: 8px 0 0; color: #334155; }
.import-analysis-item ul { padding-left: 20px; }

.import-meta {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
}

.import-draft-card .card-actions {
  margin-top: auto;
}

.import-draft-card .edit-draft-btn {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
}

.import-draft-card .edit-draft-btn:hover {
  background: #1d4ed8;
}

.import-draft-card .approve-draft-btn {
  background: #10b981;
  color: #ffffff;
  border: 1px solid #10b981;
}

.import-draft-card .approve-draft-btn:hover {
  background: #059669;
}

/* Duplicate modal buttons */

#editDuplicateDraftBtn {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
}

#editDuplicateDraftBtn:hover {
  background: #1d4ed8;
}

#mergeDuplicateDraftBtn,
#applyAiImproveBtn,
#approveFromEditorBtn {
  background: #10b981;
  color: #ffffff;
  border: 1px solid #10b981;
}

#mergeDuplicateDraftBtn:hover,
#applyAiImproveBtn:hover,
#approveFromEditorBtn:hover {
  background: #059669;
}

/* Draft editor buttons */

#saveDraftEditBtn {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
}

#saveDraftEditBtn:hover {
  background: #1d4ed8;
}

#improveDraftBtn {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

#improveDraftBtn:hover {
  background: #e0e7ff;
}

.drafts-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.draft-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #eef4ff, #f8f9ff);
  border: 1px solid #c7d2fe;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.draft-count-pill span {
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.draft-count-pill small {
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.import-hero-card {
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  border: 1px solid #dbeafe;
  border-radius: 24px;
  padding: 26px;
  margin-bottom: 30px;
  box-shadow: 0 18px 50px rgba(37, 99, 235, 0.08);
  max-width: 980px;
}

.import-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.import-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
  flex-shrink: 0;
}

.import-hero-card h2 {
  margin: 0;
  font-size: 24px;
  color: #111827;
}

.import-hero-card p {
  margin: 7px 0 0 0;
  color: #64748b;
  line-height: 1.55;
  max-width: 760px;
}

.import-form-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.import-field input,
.import-field select {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  background: #ffffff;
  color: #111827;
  outline: none;
}

.import-field input:focus,
.import-field select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.file-drop-zone {
  border: 1px dashed #93c5fd;
  background: #f8fbff;
  border-radius: 18px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.file-drop-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-drop-copy strong {
  color: #111827;
  font-size: 16px;
}

.file-drop-copy span {
  color: #64748b;
  font-size: 13px;
}

.file-drop-zone input[type="file"] {
  max-width: 360px;
  background: #ffffff;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 10px;
}

.import-action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.import-action-row .primary-btn {
  padding: 13px 20px;
}

.import-action-row .status-message {
  margin-top: 0;
  color: #2563eb;
  font-weight: 700;
}

@media (max-width: 760px) {
  .import-form-grid {
    grid-template-columns: 1fr;
  }

  .file-drop-zone {
    flex-direction: column;
    align-items: stretch;
  }

  .file-drop-zone input[type="file"] {
    max-width: 100%;
  }

  .import-hero-main {
    flex-direction: column;
  }
}

.drafts-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  color: #2563eb;
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.refresh-icon-btn:hover {
  background: #eef4ff;
  border-color: #93c5fd;
  transform: rotate(90deg);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.14);
}

.refresh-icon-btn:active {
  transform: rotate(180deg) scale(0.96);
}

.file-drop-zone {
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.file-drop-zone.drag-over {
  border-color: #2563eb;
  background: #eef4ff;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
}

.hidden-file-input {
  display: none;
}

.browse-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #ffffff;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.browse-file-btn:hover {
  background: #1d4ed8;
}

.selected-file-name {
  margin-top: 8px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}

.knowledge-source-meta {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #edf0f4;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.source-line-1 {
  font-weight: 700;
}

.source-line-2 {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.75;
}

.import-bulk-toolbar {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.bulk-left,
.bulk-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-btn {
  padding: 10px 14px;
  font-size: 13px;
}

.selected-draft-count {
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.danger-outline-btn {
  border: 1px solid #f3b4b4;
  background: #fff7f7;
  color: #dc2626;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
}

.danger-outline-btn:hover {
  background: #feeaea;
}

.draft-card-left-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.draft-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.draft-select-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .import-bulk-toolbar {
    align-items: stretch;
  }

  .bulk-left,
  .bulk-right {
    width: 100%;
  }

  .bulk-left button,
  .bulk-right button {
    flex: 1;
  }
}

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.analytics-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}

.analytics-panel-header {
  margin-bottom: 16px;
}

.analytics-panel-header h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
}

.analytics-panel-header p {
  margin: 6px 0 0 0;
  color: #6b7280;
  line-height: 1.4;
}

.analytics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-row {
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.analytics-row strong {
  display: block;
  color: #111827;
  font-size: 14px;
  line-height: 1.35;
}

.analytics-row span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.analytics-row-stat {
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.analytics-row-stack {
  align-items: flex-start;
}

.analytics-action-btn {
  white-space: nowrap;
}

.analytics-feedback-card {
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 14px;
  padding: 14px;
}

.analytics-feedback-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.analytics-feedback-top strong {
  color: #111827;
  line-height: 1.35;
}

.analytics-feedback-top span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.analytics-feedback-card p {
  margin: 10px 0;
  color: #374151;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .analytics-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .analytics-summary-grid {
    grid-template-columns: 1fr;
  }

  .analytics-row,
  .analytics-feedback-top {
    flex-direction: column;
  }
}

.analytics-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.feedback-analytics-grid {
  margin-bottom: 24px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.analytics-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}

.analytics-panel-header {
  margin-bottom: 16px;
}

.analytics-panel-header h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
}

.analytics-panel-header p {
  margin: 6px 0 0 0;
  color: #6b7280;
  line-height: 1.4;
}

.analytics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-row {
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.analytics-row strong {
  display: block;
  color: #111827;
  font-size: 14px;
  line-height: 1.35;
}

.analytics-row span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.analytics-row-stat {
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.analytics-row-stack {
  align-items: flex-start;
}

.analytics-action-btn {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .analytics-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .analytics-summary-grid {
    grid-template-columns: 1fr;
  }

  .analytics-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.association-suggestions-panel {
  margin-bottom: 24px;
}

.association-suggestion-row {
  align-items: center;
}

.approve-association-suggestion-btn {
  white-space: nowrap;
}

.knowledge-editor-panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 90;
}

.knowledge-editor-panel.open {
  display: flex;
}

.knowledge-editor-panel .panel-header {
  height: auto;
  padding: 20px 22px;
  border-bottom: 1px solid #e5e7eb;
}

.knowledge-editor-panel .panel-body {
  padding: 22px;
  overflow-y: auto;
  max-height: calc(92vh - 78px);
}

.knowledge-editor-panel::before {
  content: "";
}

.knowledge-editor-panel > .panel-header,
.knowledge-editor-panel > .panel-body {
  width: min(920px, 100%);
  background: #ffffff;
}

.knowledge-editor-panel {
  flex-direction: column;
}

.knowledge-editor-panel > .panel-header {
  border-radius: 22px 22px 0 0;
}

.knowledge-editor-panel > .panel-body {
  border-radius: 0 0 22px 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.knowledge-editor-panel input[type="text"],
.knowledge-editor-panel textarea {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  background: #ffffff;
  color: #111827;
  margin-bottom: 16px;
  outline: none;
}

.knowledge-editor-panel textarea {
  height: 220px;
  min-height: 140px;
  max-height: 28vh;
  resize: vertical;
  line-height: 1.6;
  overflow-y: auto;
}

.knowledge-editor-panel .panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

#knowledgeAiOverlay {
  z-index: 120;
}

.knowledge-editor-panel.ai-review-active > .panel-header,
.knowledge-editor-panel.ai-review-active > .panel-body {
  filter: blur(1px);
  opacity: 0.65;
  pointer-events: none;
}

@media (max-width: 800px) {
  .knowledge-editor-panel {
    padding: 12px;
  }

  .knowledge-editor-panel .panel-actions {
    grid-template-columns: 1fr;
  }
}

.analytics-section-header {
  margin: 24px 0 12px;
}

.analytics-section-header h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
}

.analytics-section-header p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 14px;
}

.historical-summary-grid {
  margin-bottom: 24px;
}

.analytics-tabs {
  margin-bottom: 24px;
}

.analytics-tab-buttons {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin-bottom: 16px;
}

.analytics-tab-btn {
  border: 0;
  background: transparent;
  color: #64748b;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.analytics-tab-btn.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.analytics-tab-panel {
  display: none;
}

.analytics-tab-panel.active {
  display: block;
}

.billing-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.billing-form input,
.billing-form textarea {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 15px;
  background: #ffffff;
  color: #111827;
  outline: none;
}

.billing-form textarea {
  min-height: 110px;
  resize: vertical;
}

.billing-form input:focus,
.billing-form textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.billing-form .primary-btn {
  margin-top: 8px;
}

.billing-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.summary-card.warning {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.summary-card.warning strong {
  color: #d97706;
}

.editable-summary-card {
  gap: 10px;
}

.wage-input-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.wage-input-wrap input {
  width: 86px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 7px 8px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: #111827;
  background: #ffffff;
}

.wage-input-wrap input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.wage-input-wrap small {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}

.summary-card-note {
  margin-top: -2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.deleted-entry-card {
  border-color: #fecaca;
  background: #fffafa;
}

.recycle-meta {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.restore-entry-btn {
  background: #e7f6ef;
  color: #2f7a60;
  border: 1px solid #b7e4cf;
}

.restore-entry-btn:hover {
  background: #dff3ea;
}

.support-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-faq-card {
  border: 1px solid #dbe2ea;
  border-radius: 16px;
  background: #ffffff;
  padding: 14px 16px;
}

.support-faq-card summary {
  cursor: pointer;
  font-weight: 700;
  color: #111827;
}

.support-faq-card p {
  margin: 10px 0 0;
  color: #64748b;
  line-height: 1.5;
  font-size: 14px;
}

.support-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-form input,
.support-form select,
.support-form textarea {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 15px;
  background: #ffffff;
  color: #111827;
  outline: none;
}

.support-form textarea {
  min-height: 140px;
  resize: vertical;
}

.support-form input:focus,
.support-form select:focus,
.support-form textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.support-snapshot-box {
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.support-snapshot-box strong {
  color: #111827;
  font-size: 13px;
}

.support-snapshot-box span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.answer-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.answer-rating-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid #dbe2ea;
  background: #ffffff;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.18s ease;
}

.feedback-icon-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.answer-header-stack {
  margin-bottom: 14px;
}

.answer-feedback-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  margin-top: 6px;
  padding: 10px 14px;

  border: 1px solid #e2e8f0;
  border-radius: 14px;

  background: #f8fafc;
}

.feedback-label {
  font-size: 14px;
  color: #475569;
  font-weight: 500;
}

.feedback-actions {
  display: flex;
  gap: 10px;
}

.feedback-btn {
  border: none;
  border-radius: 10px;

  padding: 8px 16px;

  background: #2563eb;
  color: white;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  transition: all 0.18s ease;
}

.feedback-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.feedback-btn.secondary {
  background: #64748b;
}

.answer-header-stack {
  margin-bottom: 16px;
}

.answer-feedback-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;

  margin-top: 8px;
  padding: 14px 16px;

  border: 1px solid #e2e8f0;
  border-radius: 18px;

  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,0.95),
      rgba(248,250,252,0.96)
    );

  box-shadow:
    0 1px 2px rgba(15,23,42,0.04),
    0 8px 24px rgba(15,23,42,0.04);
}
.answer-header-stack {
  margin-bottom: 16px;
}

.answer-feedback-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;

  margin-top: 8px;
  padding: 15px 16px;

  border: 1px solid #dbeafe;
  border-radius: 18px;

  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 34%),
    linear-gradient(135deg, #ffffff, #f8fbff);

  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 30px rgba(37, 99, 235, 0.08);
}

.feedback-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
}

.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.feedback-btn {
  border-radius: 999px;
  padding: 9px 17px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

/* Yes */
.feedback-btn {
  background: #e7f6ef;
  color: #2f7a60;
  border: 1px solid #b7e4cf;
  box-shadow: 0 8px 18px rgba(47, 122, 96, 0.10);
}

.feedback-btn:hover {
  background: #dff3ea;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(47, 122, 96, 0.16);
}

/* No */
.feedback-btn.secondary {
  background: #fdecec;
  color: #c05656;
  border: 1px solid #f3d1d1;
  box-shadow: 0 8px 18px rgba(192, 86, 86, 0.10);
}

.feedback-btn.secondary:hover {
  background: #fee2e2;
  border-color: #f0baba;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(192, 86, 86, 0.16);
}

.feedback-btn:active {
  transform: translateY(0) scale(0.98);
}

.hidden-feedback-row {
  display: none;
}

.hidden-feedback-row {
  display: none;
}

.answer-feedback-row {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;

  margin-top: 6px;
  padding: 10px 12px;

  border: 1px solid #dbeafe;
  border-radius: 15px;

  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 34%),
    linear-gradient(135deg, #ffffff, #f8fbff);

  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 20px rgba(37, 99, 235, 0.06);
}

.feedback-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
}

.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.feedback-btn {
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.feedback-btn.helpful {
  background: #e7f6ef;
  color: #2f7a60;
  border: 1px solid #b7e4cf;
  box-shadow: 0 6px 14px rgba(47, 122, 96, 0.10);
}

.feedback-btn.helpful:hover {
  background: #dff3ea;
  transform: translateY(-1px);
}

.feedback-btn.not-helpful {
  background: #fdecec;
  color: #c05656;
  border: 1px solid #f3d1d1;
  box-shadow: 0 6px 14px rgba(192, 86, 86, 0.10);
}

.feedback-btn.not-helpful:hover {
  background: #fee2e2;
  transform: translateY(-1px);
}

.hidden-feedback-row {
  display: none;
}

.feedback-fade-out {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.answer-feedback-row.submitted-feedback-row {
  display: inline-flex;
  padding: 8px 12px;
}

.answer-feedback-row.submitted-feedback-row .feedback-status {
  margin-top: 0;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}
.answer-feedback-row.submitted-feedback-row {
  display: inline-flex !important;
  padding: 8px 12px;
}

.answer-feedback-row.submitted-feedback-row .feedback-status {
  display: block;
  margin-top: 0;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}
.answer-feedback-row.submitted-feedback-row {
  display: inline-flex !important;
  flex-direction: column;
  align-items: flex-start;
  width: auto;
  min-width: 220px;
  padding: 9px 13px;
}

.answer-feedback-row.submitted-feedback-row .feedback-status {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  margin: 0;
  color: #2563eb;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.feedback-status:empty {
  display: none;
}

.feedback-status:not(:empty) {
  display: block;
}

.sidebar-logo-link {
  text-decoration: none;
  display: flex;
  justify-content: center;
}

.sidebar-bottom-link {
  text-decoration: none;
  display: flex;
  justify-content: center;
}

.login-card {
  position: relative;
}

.login-admin-link {
  position: absolute;
  right: 18px;
  bottom: 16px;

  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  background: #f8fafc;
  border: 1px solid #dbe2ea;

  text-decoration: none;
  font-size: 18px;

  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.login-admin-link:hover {
  background: #ffffff;
  border-color: #cbd5e1;

  transform: translateY(-1px);

  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.08);
}
.login-logo-link {
  display: inline-flex;
  text-decoration: none;
}

@media (max-width: 640px) {
  .knowledge-editor-panel {
    padding: 10px;
    align-items: stretch;
    justify-content: center;
  }

  .knowledge-editor-panel > .panel-header,
  .knowledge-editor-panel > .panel-body {
    width: 100%;
  }

  .knowledge-editor-panel > .panel-header {
    padding: 14px 16px;
  }

  .knowledge-editor-panel .panel-header h2 {
    font-size: 18px;
  }

  .knowledge-editor-panel .panel-body {
    padding: 16px;
    max-height: calc(92vh - 64px);
    overflow-y: auto;
  }

  .knowledge-editor-panel textarea {
    height: 150px;
    min-height: 120px;
    max-height: 24vh;
    overflow-y: auto;
  }

  .knowledge-editor-panel .panel-actions {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .knowledge-editor-panel .panel-actions button {
    padding: 10px 12px;
  }
}

.category-smart-select,
.custom-category-input {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  background: #ffffff;
  color: #111827;
  margin-bottom: 16px;
  outline: none;
}

.category-smart-select:focus,
.custom-category-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.custom-category-input {
  margin-top: -8px;
}

.category-smart-select {
  appearance: none;
  -webkit-appearance: none;

  width: 100%;
  min-height: 48px;

  border: 1px solid #dbeafe;
  border-radius: 14px;

  padding: 13px 44px 13px 14px;

  font-size: 15px;
  font-weight: 600;
  color: #111827;

  background:
    linear-gradient(45deg, transparent 50%, #2563eb 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, #ffffff, #f8fbff);

  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 22px rgba(37, 99, 235, 0.06);

  cursor: pointer;
}

.category-smart-select:hover {
  border-color: #93c5fd;
  background:
    linear-gradient(45deg, transparent 50%, #1d4ed8 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, #ffffff, #eef4ff);
}

.category-smart-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.12),
    0 10px 26px rgba(37, 99, 235, 0.10);
}

.custom-category-input {
  margin-top: -6px;
  border-radius: 14px;
  border-color: #dbeafe;
  background: #ffffff;
  font-weight: 700;
}

.category-smart-select {
  font-weight: 600;
}

.category-smart-select option {
  font-weight: 500;
}

.category-smart-select {
  font-weight: 500;
  color: #334155;
}

.answer-link {
  color: #93c5fd;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(147, 197, 253, 0.45);
}

.answer-link:hover {
  color: #bfdbfe;
  border-color: rgba(191, 219, 254, 0.8);
}

.source-document-links {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-document-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;

  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(147, 197, 253, 0.28);

  border-radius: 999px;
  padding: 8px 12px;

  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.source-document-link:hover {
  background: rgba(37, 99, 235, 0.26);
  border-color: rgba(147, 197, 253, 0.55);
}

/* ============================================================
   InstInt AAA login refresh merged from new-style.css
   Scoped to body.login-body so dashboard/admin styles stay intact.
   ============================================================ */

:root {
  --ink: #f8fbff;
  --muted: rgba(225, 232, 255, 0.72);
  --soft: rgba(225, 232, 255, 0.54);
  --panel: rgba(6, 10, 31, 0.64);
  --panel-strong: rgba(9, 13, 39, 0.86);
  --line: rgba(135, 151, 255, 0.32);
  --blue: #276cff;
  --cyan: #22c9ff;
  --violet: #8b35ff;
  --purple: #a23cff;
  --danger: #ff6b8f;
}

body.login-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--ink);
  background: #040718 url("/login-background.png") center / cover no-repeat fixed;
  overflow: hidden;
}

body.login-body::before,
body.login-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body.login-body::before {
  background:
    radial-gradient(circle at 50% 35%, rgba(71, 86, 255, 0.12), transparent 28%),
    radial-gradient(circle at 82% 48%, rgba(160, 58, 255, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(2, 5, 19, 0.14), rgba(2, 5, 19, 0.64));
}

body.login-body::after {
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black 0 38%, transparent 72%);
}

body.login-body .login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px 72px;
}

body.login-body .login-card {
  position: relative;
  width: min(92vw, 560px);
  padding: 48px 56px 76px;
  overflow: hidden;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(18, 26, 72, 0.78), rgba(4, 8, 28, 0.84)),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.045) inset,
    0 0 40px rgba(39, 108, 255, 0.18),
    0 0 120px rgba(139, 53, 255, 0.16),
    0 36px 90px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(22px) saturate(138%);
  -webkit-backdrop-filter: blur(22px) saturate(138%);
}

body.login-body .login-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(61, 163, 255, .86), rgba(176, 64, 255, .74), rgba(255,255,255,.16));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

body.login-body .card-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  right: -130px;
  top: -160px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(150, 56, 255, .38), rgba(39, 108, 255, .16) 42%, transparent 72%);
  filter: blur(4px);
  pointer-events: none;
}

body.login-body .brand-block {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

body.login-body .brand-logo {
  width: min(360px, 82%);
  height: auto;
  display: block;
  filter:
    drop-shadow(0 0 14px rgba(39, 108, 255, .38))
    drop-shadow(0 0 26px rgba(162, 60, 255, .20));
}

body.login-body .login-copy {
  position: relative;
  text-align: center;
  margin-bottom: 34px;
}

body.login-body .eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(122, 194, 255, .9);
}

body.login-body .login-copy h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

body.login-body .login-copy p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
}

body.login-body .login-form {
  position: relative;
  display: grid;
  gap: 14px;
}

body.login-body .field-label {
  color: rgba(249, 251, 255, 0.92);
  font-size: 14px;
  font-weight: 600;
}

body.login-body .input-wrap {
  position: relative;
}

body.login-body .input-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 23px;
  height: 23px;
  transform: translateY(-50%);
  stroke: rgba(225, 232, 255, 0.72);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

body.login-body .login-input {
  width: 100%;
  height: 66px;
  padding: 0 22px 0 58px;
  border: 1px solid rgba(128, 143, 255, .48);
  border-radius: 14px;
  outline: none;
  color: #fff;
  font-size: 20px;
  letter-spacing: .02em;
  background: rgba(5, 9, 32, .44);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.02) inset,
    0 0 26px rgba(68, 104, 255, .08);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

body.login-body .login-input::placeholder {
  color: rgba(225, 232, 255, .52);
}

body.login-body .login-input:focus {
  border-color: rgba(73, 192, 255, .9);
  background: rgba(7, 12, 42, .68);
  box-shadow:
    0 0 0 4px rgba(39, 108, 255, .16),
    0 0 42px rgba(111, 62, 255, .22);
}

body.login-body .primary-btn {
  position: relative;
  height: 68px;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  font-size: 19px;
  font-weight: 600;
  background: linear-gradient(100deg, var(--blue), #5d63ff 47%, var(--purple));
  box-shadow:
    0 16px 34px rgba(39, 108, 255, .24),
    0 0 34px rgba(162, 60, 255, .24);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

body.login-body .primary-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.22), transparent 52%);
  pointer-events: none;
}

body.login-body .primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow:
    0 18px 40px rgba(39, 108, 255, .32),
    0 0 48px rgba(162, 60, 255, .34);
}

body.login-body .primary-btn:active { transform: translateY(1px) scale(.997); }

body.login-body .primary-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

body.login-body .login-status {
  min-height: 22px;
  margin-top: 14px;
  text-align: center;
  color: var(--danger);
  font-weight: 700;
}

body.login-body .secure-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 20px 0 26px;
  color: var(--soft);
  font-size: 14px;
}

body.login-body .secure-divider span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(225,232,255,.22), transparent);
}

body.login-body .secure-divider strong {
  font-weight: 700;
  color: rgba(225,232,255,.72);
}

body.login-body .trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 6px;
}

body.login-body .trust-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(250, 252, 255, .9);
  font-weight: 700;
  font-size: 15px;
}

body.login-body .trust-item svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: url(#unused);
  stroke: #765bff;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px rgba(82, 110, 255, .7));
}

body.login-body .login-admin-link {
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: rgba(241, 246, 255, .86);
  border: 1px solid rgba(136, 151, 255, .26);
  background: rgba(9, 14, 42, .56);
  box-shadow: 0 0 28px rgba(91, 93, 255, .18);
  text-decoration: none;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

body.login-body .login-admin-link:hover {
  transform: translateY(-1px);
  background: rgba(18, 24, 65, .76);
  border-color: rgba(122, 194, 255, .58);
}

body.login-body .login-admin-link svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.login-body .login-footnote {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 24px;
  margin: 0;
  text-align: center;
  color: rgba(225, 232, 255, .52);
  font-size: 14px;
}

@media (max-width: 640px) {
  body.login-body { overflow: auto; }
  body.login-body .login-shell { padding: 24px 14px 72px; }
  body.login-body .login-card {
    width: 100%;
    padding: 36px 24px 76px;
    border-radius: 26px;
  }
  body.login-body .brand-logo { width: min(330px, 90%); }
  body.login-body .trust-row { grid-template-columns: 1fr; gap: 12px; }
  body.login-body .trust-item { justify-content: flex-start; padding-left: 22%; }
}

/* Founder MFA QR setup */
.founder-mfa-setup-box {
  margin-top: 18px;
  padding: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.founder-mfa-title {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 1.1rem;
}

.founder-mfa-copy,
.founder-setup-hint {
  color: rgba(225, 232, 255, 0.74);
  font-size: 0.9rem;
  line-height: 1.45;
}

.founder-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.founder-qr-image {
  width: 240px;
  height: 240px;
  padding: 12px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25);
}

.founder-manual-secret-wrap {
  margin: 10px 0 16px;
  color: rgba(225, 232, 255, 0.78);
}

.founder-manual-secret-wrap summary {
  cursor: pointer;
  color: #ffffff;
  font-weight: 700;
}

.founder-manual-secret {
  display: block;
  margin-top: 8px;
  padding: 10px;
  word-break: break-all;
  border-radius: 12px;
  color: #dff7ff;
  background: rgba(0, 0, 0, 0.22);
}

.login-status.error {
  color: #ffd3d3 !important;
}


/* Login/setup viewport fix: allow normal scrolling and keep action buttons reachable */
body.login-body {
  min-height: 100dvh;
  overflow-y: auto !important;
  overflow-x: hidden;
  align-items: flex-start;
  justify-content: center;
}

body.login-body .login-shell {
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(16px, 3vh, 28px) 16px 72px;
  box-sizing: border-box;
}

body.login-body .login-card {
  box-sizing: border-box;
  max-height: none;
  overflow: visible;
  padding: clamp(24px, 4vh, 42px) clamp(22px, 5vw, 50px) clamp(44px, 5vh, 70px);
}

body.login-body .brand-block {
  margin-bottom: clamp(14px, 2vh, 24px);
}

body.login-body .brand-logo {
  width: min(300px, 76%);
}

body.login-body .login-copy {
  margin-bottom: clamp(16px, 2.4vh, 28px);
}

body.login-body .login-copy h1 {
  font-size: clamp(28px, 3.4vw, 40px);
}

body.login-body .login-copy p:not(.eyebrow) {
  font-size: 15px;
}

body.login-body .login-form {
  gap: 10px;
}

body.login-body .login-input {
  height: 56px;
  font-size: 17px;
}

body.login-body .primary-btn {
  height: 58px;
  font-size: 17px;
  margin-top: 10px;
}

body.login-body .secure-divider {
  margin: 16px 0 18px;
}

body.login-body .login-footnote {
  position: relative;
  bottom: auto;
  margin-top: 18px;
  padding-bottom: 8px;
}

body.login-body .login-admin-link {
  bottom: 18px;
  right: 18px;
}

.founder-mfa-setup-box {
  max-width: 100%;
}

.founder-qr-image {
  width: min(220px, 72vw);
  height: auto;
}

@media (max-height: 760px) {
  body.login-body .brand-logo {
    width: min(240px, 68%);
  }

  body.login-body .login-card {
    padding-top: 22px;
    padding-bottom: 50px;
  }

  body.login-body .login-copy h1 {
    font-size: 30px;
  }

  body.login-body .login-copy p:not(.eyebrow),
  .founder-mfa-copy,
  .founder-setup-hint {
    font-size: 14px;
  }

  body.login-body .trust-row,
  body.login-body .secure-divider {
    display: none;
  }
}

@media (max-width: 640px) {
  body.login-body .login-shell {
    padding: 14px 10px 56px;
  }

  body.login-body .login-card {
    width: 100%;
    padding: 24px 18px 56px;
    border-radius: 24px;
  }

  body.login-body .brand-logo {
    width: min(240px, 78%);
  }

  body.login-body .login-input {
    height: 54px;
  }

  body.login-body .primary-btn {
    height: 56px;
  }
}


/* Preserve answer formatting from approved knowledge entries */
.answer-main {
  white-space: normal;
}

.formatted-answer-line {
  display: block;
  min-height: 1.35em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.formatted-answer-bullet {
  padding-left: 1.15em;
  text-indent: -0.85em;
}

.formatted-answer-spacer {
  min-height: 0.7em;
}


/* Formatted answer body */
.answer-main {
  display: block;
  white-space: normal;
}

.answer-main .formatted-answer-line {
  display: block;
  min-height: 1.35em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.answer-main .formatted-answer-bullet {
  padding-left: 1.15em;
  text-indent: -0.85em;
}

.answer-main .formatted-answer-spacer {
  min-height: 0.8em;
}


/* Founder account management */
.founder-mfa-qr-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.founder-mfa-qr {
  width: 240px;
  height: 240px;
  object-fit: contain;
  display: block;
}

.founder-account-row {
  align-items: center;
  gap: 16px;
}

.founder-account-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.founder-account-row > div:first-child span {
  color: rgba(100, 116, 139, 0.9);
  font-size: 0.9rem;
}

.founder-account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill.active {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.24);
}

.status-pill.inactive {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
  border: 1px solid rgba(100, 116, 139, 0.22);
}

@media (max-width: 720px) {
  .founder-account-row,
  .founder-account-actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .founder-account-actions {
    width: 100%;
  }

  .founder-mfa-qr {
    width: 210px;
    height: 210px;
  }
}

/* Staff login progressive security steps */
body.login-body .login-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

body.login-body .login-actions .primary-btn {
  flex: 1;
}

body.login-body .login-actions .secondary-btn {
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

body.login-body .login-step-context {
  display: grid;
  gap: 4px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 13px;
}

body.login-body .login-step-context strong {
  color: var(--ink);
  font-size: 14px;
}


/* =========================================================
   FINAL OVERRIDE: GLOBAL FONT STACK
   ========================================================= */
:root {
  --instint-font-main: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --instint-font-code: "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, monospace;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--instint-font-main) !important;
}

code,
kbd,
pre,
samp,
#branchCode,
#staffEmployeeCode,
#staffMfaCode,
#adminMfaCode,
#founderMfaCode,
#newFounderMfaCode,
#selfMfaCode,
#reauthMfaCode,
#branchCodeInput,
#clientBranchCode,
#roleCode,
#userEmployeeCode,
#userNewRoleCode,
.founder-manual-secret,
.founder-mfa-confirm-code,
.role-mfa-code-input,
.role-login-code,
.role-user-code,
.roles-code-preview strong,
.role-generated-box strong,
.security-mfa-secret code,
.role-mfa-secret code,
.founder-created-meta code {
  font-family: var(--instint-font-code) !important;
}

/* =========================================================
   FINAL OVERRIDE: CRISPER NATIVE FONT RENDERING
   ========================================================= */
:root {
  --instint-weight-regular: 400;
  --instint-weight-medium: 500;
  --instint-weight-semibold: 600;
  --instint-weight-bold: 700;
}

html,
body,
button,
input,
select,
textarea {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
}


/* ==========================================================================
   Public website
   Source: styles-src/10-site.css
   ========================================================================== */
body.site-surface {
  --page: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f0f2f8;
  --surface-tint: #eef2fb;
  --ink: #172033;
  --ink-2: #29344b;
  --muted: #667085;
  --muted-2: #7b8495;
  --line: #dfe3ec;
  --line-strong: #c9cfe0;
  --brand: #35447f;
  --brand-2: #4f5fa8;
  --brand-dark: #27325e;
  --brand-soft: #e8e9f7;
  --blue-soft: #e8f3fb;
  --blue: #2f6f9f;
  --green-soft: #eaf6ef;
  --green: #2f7450;
  --amber-soft: #fff5df;
  --amber: #8a6116;
  --danger: #9c3f47;
  --danger-soft: #fff0f1;
  --focus: rgba(70, 92, 168, .22);
  --shadow-sm: 0 8px 24px rgba(26, 35, 58, .07);
  --shadow-md: 0 18px 48px rgba(26, 35, 58, .11);
  --shadow-lg: 0 28px 80px rgba(31, 40, 67, .14);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --container: 1180px;
  --header-h: 76px;
}

body.site-surface,
body.site-surface * { box-sizing: border-box; }
body.site-surface {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--page);
  font-family: "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body.site-surface.modal-open { overflow: hidden; }
body.site-surface img, body.site-surface svg { display: block; max-width: 100%; }
body.site-surface a { color: inherit; }
body.site-surface button, body.site-surface input, body.site-surface select, body.site-surface textarea { font: inherit; }
body.site-surface button, body.site-surface a { -webkit-tap-highlight-color: transparent; }
body.site-surface button { cursor: pointer; }
body.site-surface ::selection { background: #d8def8; color: var(--ink); }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--brand-dark);
  color: #fff;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

.container { width: min(var(--container), calc(100% - 40px)); margin-inline: auto; }
.container-narrow { width: min(860px, calc(100% - 40px)); margin-inline: auto; }
.section { padding: 92px 0; }
.section-sm { padding: 64px 0; }
.section-tight { padding: 44px 0; }
.section-white { background: var(--surface); }
.section-tint { background: var(--surface-tint); }
.section-brand {
  color: #fff;
  background:
    radial-gradient(circle at 15% 10%, rgba(149, 179, 255, .23), transparent 28%),
    radial-gradient(circle at 85% 84%, rgba(179, 205, 255, .15), transparent 28%),
    linear-gradient(135deg, var(--brand-dark), var(--brand));
}
.section-header { max-width: 760px; margin-bottom: 42px; }
.section-header.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--brand);
  font-size: .78rem;
  font-weight: 760;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
.section-brand .eyebrow { color: #cbd6ff; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid #d5daea;
  border-radius: 999px;
  color: var(--ink-2);
  background: rgba(255,255,255,.76);
  box-shadow: 0 6px 18px rgba(31,42,75,.05);
  font-size: .84rem;
  font-weight: 650;
}
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: #5d72c3; box-shadow: 0 0 0 4px rgba(93,114,195,.13); }

body.site-surface h1, body.site-surface h2, body.site-surface h3, body.site-surface h4 { margin: 0; color: var(--ink); line-height: 1.08; letter-spacing: -.035em; }
body.site-surface h1 { font-size: clamp(2.65rem, 6vw, 5.45rem); font-weight: 760; }
body.site-surface h2 { font-size: clamp(2rem, 4.3vw, 3.65rem); font-weight: 740; }
body.site-surface h3 { font-size: clamp(1.22rem, 2vw, 1.55rem); font-weight: 720; letter-spacing: -.025em; }
body.site-surface h4 { font-size: 1rem; font-weight: 720; letter-spacing: -.015em; }
.section-brand h1, .section-brand h2, .section-brand h3 { color: #fff; }
body.site-surface p { margin: 0; }
.lead { color: var(--muted); font-size: clamp(1.08rem, 1.8vw, 1.32rem); line-height: 1.6; }
.section-brand .lead, .section-brand .muted { color: #d8dff4; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.tiny { font-size: .78rem; }
.text-center { text-align: center; }
.max-640 { max-width: 640px; }
.max-760 { max-width: 760px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  border-bottom: 1px solid rgba(207, 213, 227, .82);
  background: rgba(255,255,255,.91);
  backdrop-filter: blur(18px) saturate(1.18);
}
.header-inner {
  width: min(var(--container), calc(100% - 36px));
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
}
.brand img { width: 38px; height: 38px; }
.brand-word { font-size: 1.26rem; font-weight: 770; letter-spacing: -.04em; }
.brand-word span { color: var(--brand-2); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 11px;
  border-radius: 9px;
  color: #475067;
  font-size: .93rem;
  font-weight: 620;
  text-decoration: none;
  transition: color .18s ease, background .18s ease;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand-dark); background: var(--brand-soft); }
.header-actions { display: flex; align-items: center; gap: 9px; margin-left: 8px; }
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
}
.menu-toggle svg { width: 22px; }
.mobile-panel { display: none; }

.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: .95rem;
  font-weight: 680;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 8px 22px rgba(53,68,127,.19); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 11px 28px rgba(53,68,127,.25); }
.btn-secondary { color: var(--brand-dark); border-color: #cdd3e5; background: #fff; }
.btn-secondary:hover { border-color: #abb6d4; background: #f7f8fc; }
.btn-quiet { color: var(--ink-2); border-color: transparent; background: transparent; }
.btn-quiet:hover { background: var(--surface-soft); }
.btn-light { color: var(--brand-dark); background: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.btn-light:hover { background: #f7f8ff; }
.btn-outline-light { color: #fff; border-color: rgba(255,255,255,.38); background: rgba(255,255,255,.07); }
.btn-outline-light:hover { border-color: rgba(255,255,255,.65); background: rgba(255,255,255,.12); }
.btn-sm { min-height: 40px; padding-inline: 14px; font-size: .88rem; }
.btn-lg { min-height: 54px; padding-inline: 23px; border-radius: 13px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btn[disabled] { cursor: not-allowed; opacity: .58; transform: none; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 82px 0 96px;
  background:
    radial-gradient(circle at 85% 12%, rgba(119, 145, 224, .19), transparent 26%),
    radial-gradient(circle at 8% 76%, rgba(177, 205, 235, .2), transparent 26%),
    linear-gradient(180deg, #fbfcff 0%, #f5f7fb 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--line);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(430px, .98fr); gap: 64px; align-items: center; }
.hero-copy h1 { margin-top: 22px; max-width: 760px; }
.hero-copy h1 em { color: var(--brand); font-style: normal; }
.hero-copy .lead { max-width: 680px; margin-top: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { display: flex; align-items: center; gap: 10px; margin-top: 23px; color: var(--muted); font-size: .9rem; }
.hero-note svg { width: 17px; color: var(--green); flex: 0 0 auto; }

.product-stage { position: relative; }
.product-stage::before {
  content: "";
  position: absolute;
  inset: -24px -20px -28px;
  border-radius: 38px;
  background: linear-gradient(135deg, rgba(232,233,247,.92), rgba(232,243,251,.72));
  transform: rotate(-2deg);
}
.app-window {
  position: relative;
  overflow: hidden;
  border: 1px solid #d5daea;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.app-topbar { height: 50px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.window-dot { width: 9px; height: 9px; border-radius: 50%; background: #c8ccda; }
.app-title { margin-left: 7px; color: var(--muted); font-size: .75rem; font-weight: 650; }
.app-layout { display: grid; grid-template-columns: 142px 1fr; min-height: 440px; }
.app-sidebar { padding: 16px 10px; background: #303b70; color: #fff; }
.app-logo-mini { display: flex; align-items: center; gap: 7px; padding: 4px 7px 18px; font-weight: 730; }
.app-logo-mini img { width: 26px; }
.app-nav-item { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; padding: 9px; border-radius: 8px; color: rgba(255,255,255,.74); font-size: .72rem; }
.app-nav-item.active { color: #fff; background: rgba(255,255,255,.14); }
.app-nav-item svg { width: 14px; }
.app-main { padding: 22px; background: #f7f8fb; }
.app-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-heading strong { font-size: .95rem; }
.mini-badge { padding: 5px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: .62rem; font-weight: 700; }
.ask-card { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 7px 20px rgba(34,43,68,.05); }
.ask-label { color: var(--muted); font-size: .67rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.question-box { display: flex; align-items: center; gap: 8px; margin-top: 9px; padding: 10px 12px; border: 1px solid #cfd5e5; border-radius: 9px; color: var(--ink-2); background: #fbfcff; font-size: .76rem; }
.question-box svg { width: 15px; color: var(--brand); }
.answer-card { margin-top: 12px; padding: 15px; border-left: 3px solid var(--brand-2); border-radius: 9px; background: var(--brand-soft); }
.answer-label { display: flex; align-items: center; gap: 6px; color: var(--brand-dark); font-size: .66rem; font-weight: 730; }
.answer-copy { margin-top: 7px; color: #303a55; font-size: .74rem; line-height: 1.55; }
.source-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(53,68,127,.15); color: #59617a; font-size: .63rem; }
.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 13px; }
.insight-card { min-height: 70px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.insight-card span { display: block; color: var(--muted); font-size: .6rem; }
.insight-card strong { display: block; margin-top: 7px; color: var(--ink-2); font-size: .78rem; }
.float-card { position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid #d7dceb; border-radius: 12px; background: rgba(255,255,255,.95); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); }
.float-card.one { left: -28px; bottom: 32px; }
.float-card.two { right: -28px; top: 44px; }
.float-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); }
.float-icon svg { width: 17px; }
.float-copy strong { display: block; font-size: .74rem; }
.float-copy span { display: block; color: var(--muted); font-size: .63rem; }

.logo-strip { border-bottom: 1px solid var(--line); background: #fff; }
.logo-strip-inner { display: flex; min-height: 82px; align-items: center; justify-content: center; gap: 28px; text-align: center; }
.logo-strip p { color: var(--muted); font-size: .92rem; }
.logo-strip strong { color: var(--ink-2); }
.pill-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pill { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: #536078; background: #fafbfe; font-size: .79rem; font-weight: 620; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
.split { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 72px; align-items: center; }
.split.reverse { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 7px 24px rgba(35,44,70,.045); }
.card-pad { padding: 26px; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-hover:hover { transform: translateY(-3px); border-color: #c6cde0; box-shadow: var(--shadow-sm); }
.icon-card { padding: 25px; }
.icon-box { display: grid; width: 46px; height: 46px; place-items: center; margin-bottom: 20px; border-radius: 13px; color: var(--brand); background: var(--brand-soft); }
.icon-box.blue { color: var(--blue); background: var(--blue-soft); }
.icon-box.green { color: var(--green); background: var(--green-soft); }
.icon-box.amber { color: var(--amber); background: var(--amber-soft); }
.icon-box svg { width: 23px; height: 23px; }
.icon-card p { margin-top: 11px; color: var(--muted); font-size: .94rem; }

.story-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow-sm); }
.story-head { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.story-head div { padding: 18px 24px; font-size: .86rem; font-weight: 730; }
.story-head div:first-child { color: #76585b; background: #faf2f3; }
.story-head div:last-child { color: var(--brand-dark); background: var(--brand-soft); }
.story-row { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.story-row:last-child { border-bottom: 0; }
.story-cell { display: flex; gap: 12px; padding: 22px 24px; }
.story-cell:first-child { border-right: 1px solid var(--line); background: #fffdfd; }
.story-cell:last-child { background: #fdfdff; }
.story-cell svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; }
.story-cell:first-child svg { color: #a45d64; }
.story-cell:last-child svg { color: var(--brand); }
.story-cell strong { display: block; font-size: .95rem; }
.story-cell p { margin-top: 4px; color: var(--muted); font-size: .86rem; }

.steps { position: relative; }
.step { display: grid; grid-template-columns: 58px 1fr; gap: 20px; padding-bottom: 30px; }
.step:last-child { padding-bottom: 0; }
.step-number { position: relative; z-index: 2; display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid #cbd2e4; border-radius: 14px; color: var(--brand); background: #fff; font-weight: 760; box-shadow: 0 6px 18px rgba(35,46,82,.06); }
.step:not(:last-child) .step-number::after { content: ""; position: absolute; top: 49px; left: 23px; width: 1px; height: calc(100% + 10px); background: #d8ddea; }
.step-copy { padding-top: 4px; }
.step-copy p { margin-top: 7px; color: var(--muted); }

.callout { position: relative; overflow: hidden; padding: 36px; border: 1px solid #d1d7e8; border-radius: 22px; background: linear-gradient(135deg, #f2f4fc, #edf5fb); }
.callout::after { content: ""; position: absolute; right: -50px; bottom: -70px; width: 190px; height: 190px; border-radius: 50%; background: rgba(79,95,168,.08); }
.callout > * { position: relative; z-index: 1; }
.callout-row { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.callout p { margin-top: 10px; color: var(--muted); }

.quote-card { padding: 30px; border: 1px solid #d5dbea; border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); }
.quote-mark { color: #b7c0df; font-size: 4rem; font-family: Georgia, serif; line-height: .7; }
.quote-card blockquote { margin: 18px 0 0; color: var(--ink-2); font-size: 1.15rem; line-height: 1.62; }
.quote-card footer { margin-top: 20px; color: var(--muted); font-size: .86rem; }

.audience-card { padding: 25px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.audience-label { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: var(--brand); background: var(--brand-soft); font-size: .7rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.audience-card h3 { margin-top: 18px; }
.audience-card p { margin-top: 10px; color: var(--muted); font-size: .92rem; }

.check-list { display: grid; gap: 13px; margin: 24px 0 0; padding: 0; list-style: none; }
.check-list li { display: flex; gap: 11px; color: var(--ink-2); }
.check-list svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; color: var(--green); }
.check-list.compact { gap: 9px; }
.check-list.compact li { font-size: .9rem; }

.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metric { padding: 20px; border: 1px solid rgba(255,255,255,.18); border-radius: 15px; background: rgba(255,255,255,.08); }
.metric strong { display: block; color: #fff; font-size: 1.08rem; }
.metric span { display: block; margin-top: 5px; color: #cbd3eb; font-size: .78rem; }

.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 2px; border: 0; color: var(--ink); background: transparent; text-align: left; font-weight: 700; }
.faq-button svg { width: 20px; transition: transform .2s ease; }
.faq-item.open .faq-button svg { transform: rotate(45deg); }
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.faq-item.open .faq-answer { grid-template-rows: 1fr; }
.faq-answer > div { overflow: hidden; }
.faq-answer p { max-width: 820px; padding: 0 42px 22px 2px; color: var(--muted); }

.page-hero { padding: 80px 0 72px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfcff, #f4f6fb); }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 58px; align-items: center; }
.page-hero h1 { margin-top: 18px; font-size: clamp(2.5rem, 5.7vw, 4.8rem); }
.page-hero .lead { margin-top: 20px; }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }
.page-visual { padding: 26px; border: 1px solid #d6dbea; border-radius: 24px; background: linear-gradient(145deg, #eef0fa, #eaf3f9); }
.visual-stack { display: grid; gap: 12px; }
.visual-row { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid #dce1ec; border-radius: 13px; background: #fff; box-shadow: 0 5px 16px rgba(36,45,70,.04); }
.visual-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--brand); background: var(--brand-soft); }
.visual-icon svg { width: 19px; }
.visual-row strong { display: block; font-size: .85rem; }
.visual-row span { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; }

.feature-band { display: grid; grid-template-columns: .92fr 1.08fr; gap: 62px; align-items: center; }
.feature-demo { padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); }
.demo-toolbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.demo-toolbar strong { font-size: .9rem; }
.demo-screen { margin-top: 15px; padding: 17px; border-radius: 14px; background: #f6f7fb; }
.demo-line { height: 8px; margin-bottom: 8px; border-radius: 6px; background: #dfe3ee; }
.demo-line.short { width: 42%; }
.demo-line.medium { width: 67%; }
.demo-line.brand { width: 84%; background: #c9cfea; }
.demo-answer { margin-top: 16px; padding: 15px; border: 1px solid #d7dced; border-radius: 12px; background: #fff; }
.demo-answer-head { display: flex; justify-content: space-between; gap: 12px; font-size: .72rem; font-weight: 700; }
.demo-answer .demo-line { height: 7px; }

.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.security-item { display: flex; gap: 15px; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.security-item .icon-box { width: 40px; height: 40px; flex: 0 0 auto; margin: 0; border-radius: 11px; }
.security-item h3 { font-size: 1.02rem; }
.security-item p { margin-top: 5px; color: var(--muted); font-size: .87rem; }
.disclosure { padding: 20px 22px; border-left: 4px solid var(--amber); border-radius: 10px; color: #5e4b25; background: var(--amber-soft); }
.disclosure strong { display: block; }
.disclosure p { margin-top: 5px; font-size: .9rem; }

.form-card { padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-md); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
body.site-surface label { color: var(--ink-2); font-size: .86rem; font-weight: 670; }
.input, input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #cfd5e2;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
body.site-surface textarea { min-height: 126px; resize: vertical; }
body.site-surface input:focus, body.site-surface select:focus, body.site-surface textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--focus); }
body.site-surface input::placeholder, body.site-surface textarea::placeholder { color: #98a0af; }
.field-help { color: var(--muted); font-size: .76rem; }
.form-status { display: none; margin-top: 14px; padding: 11px 13px; border-radius: 9px; font-size: .88rem; }
.form-status.show { display: block; }
.form-status.success { color: var(--green); background: var(--green-soft); }
.form-status.error { color: var(--danger); background: var(--danger-soft); }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.pilot-layout { display: grid; grid-template-columns: minmax(0, .82fr) minmax(420px, 1.18fr); gap: 58px; align-items: start; }
.pilot-side { position: sticky; top: calc(var(--header-h) + 28px); }
.pilot-side h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.pilot-side .lead { margin-top: 17px; }
.pilot-points { display: grid; gap: 13px; margin-top: 28px; }
.pilot-point { display: flex; gap: 12px; }
.pilot-point svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 3px; color: var(--brand); }
.pilot-point strong { display: block; font-size: .93rem; }
.pilot-point p { margin-top: 3px; color: var(--muted); font-size: .84rem; }

.login-page { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .72fr); }
.login-story { display: flex; align-items: center; padding: 72px max(38px, calc((100vw - var(--container))/2)); color: #fff; background: radial-gradient(circle at 15% 16%, rgba(152,180,255,.25), transparent 28%), linear-gradient(135deg, var(--brand-dark), #3e4d89); }
.login-story h1 { color: #fff; font-size: clamp(2.5rem, 5vw, 4.7rem); }
.login-story .lead { margin-top: 20px; color: #d8dff4; }
.login-story .check-list li { color: #e9ecf8; }
.login-story .check-list svg { color: #a9dcbd; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 50px 34px; background: #f6f7fb; }
.login-box { width: min(100%, 430px); }
.login-box .brand { margin-bottom: 36px; }
.login-box h2 { font-size: 2.1rem; }
.login-box > p { margin-top: 9px; color: var(--muted); }
.login-form { margin-top: 28px; }
.login-form .field + .field { margin-top: 16px; }
.login-form .btn { margin-top: 20px; }
.login-links { display: flex; justify-content: space-between; gap: 14px; margin-top: 20px; font-size: .83rem; }
.login-links a { color: var(--brand); text-decoration: none; }
.login-context { display: none; margin: 18px 0 0; padding: 13px; border: 1px solid #d5dbea; border-radius: 10px; background: var(--brand-soft); }
.login-context.show { display: block; }
.login-context strong { display: block; color: var(--brand-dark); font-size: .9rem; }
.login-context span { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; }
.challenge-fields { display: none; }
.challenge-fields.show { display: block; }
.login-status { display: none; margin-top: 16px; padding: 11px 13px; border-radius: 9px; font-size: .86rem; }
.login-status.show { display: block; }
.login-status.error { color: var(--danger); background: var(--danger-soft); }
.login-status.info { color: var(--brand-dark); background: var(--brand-soft); }

.modal-backdrop { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(20,27,48,.58); backdrop-filter: blur(7px); }
.modal-backdrop.open { display: flex; }
.modal { width: min(100%, 470px); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid rgba(255,255,255,.42); border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(15,21,40,.32); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 25px 25px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.65rem; }
.modal-head p { margin-top: 6px; color: var(--muted); font-size: .88rem; }
.modal-close { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-2); background: #fff; }
.modal-close:hover { background: var(--surface-soft); }
.modal-close svg { width: 19px; }
.modal-body { padding: 22px 25px 26px; }
.modal-body .login-form { margin-top: 0; }
.modal-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .77rem; text-align: center; }
.modal-foot a { color: var(--brand); }

.cta-panel { display: flex; align-items: center; justify-content: space-between; gap: 34px; padding: 44px; border-radius: 26px; color: #fff; background: radial-gradient(circle at 12% 10%, rgba(164,190,255,.24), transparent 28%), linear-gradient(135deg, var(--brand-dark), var(--brand)); box-shadow: var(--shadow-md); }
.cta-panel h2 { color: #fff; font-size: clamp(2rem, 4.5vw, 3.45rem); }
.cta-panel p { max-width: 680px; margin-top: 12px; color: #dce2f5; }
.cta-actions { display: flex; flex: 0 0 auto; flex-direction: column; gap: 10px; min-width: 190px; }

/* Keep dark CTA typography and its light action independent from generic site colors. */
body.site-surface .cta-panel,
body.site-surface .cta-panel h1,
body.site-surface .cta-panel h2,
body.site-surface .cta-panel h3,
body.site-surface .cta-panel strong { color: #ffffff; }
body.site-surface .cta-panel p,
body.site-surface .cta-panel li { color: #dfe6ff; }
body.site-surface .cta-panel .btn.btn-light,
body.site-surface .cta-panel a.btn.btn-light { color: #17224a; background: #ffffff; }
body.site-surface .cta-panel .btn.btn-light:hover,
body.site-surface .cta-panel a.btn.btn-light:hover { color: #111a3d; background: #f3f5ff; }
body.site-surface .cta-panel .btn.btn-outline-light,
body.site-surface .cta-panel a.btn.btn-outline-light { color: #ffffff; }

.site-footer { padding: 58px 0 26px; border-top: 1px solid var(--line); background: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.45fr repeat(3, .75fr); gap: 46px; }
.footer-brand p { max-width: 390px; margin-top: 15px; color: var(--muted); font-size: .9rem; }
.footer-col h3 { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.footer-links { display: grid; gap: 9px; margin-top: 16px; }
.footer-links a { color: var(--muted); font-size: .88rem; text-decoration: none; }
.footer-links a:hover { color: var(--brand); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-legal a { text-decoration: none; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 1040px) {
  .nav { display: none; }
  .header-actions .btn-primary { display: none; }
  .menu-toggle { display: inline-flex; }
  .mobile-panel {
    position: fixed;
    inset: var(--header-h) 0 auto;
    z-index: 999;
    display: grid;
    grid-template-rows: 0fr;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.98);
    transition: grid-template-rows .22s ease;
  }
  .mobile-panel.open { grid-template-rows: 1fr; box-shadow: 0 18px 34px rgba(25,34,57,.11); }
  .mobile-panel-inner { overflow: hidden; }
  .mobile-nav { width: min(var(--container), calc(100% - 36px)); margin-inline: auto; padding: 12px 0 22px; }
  .mobile-nav a { display: flex; min-height: 44px; align-items: center; padding: 0 10px; border-radius: 9px; color: var(--ink-2); font-weight: 620; text-decoration: none; }
  .mobile-nav a:hover, .mobile-nav a[aria-current="page"] { color: var(--brand-dark); background: var(--brand-soft); }
  .mobile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .hero-grid, .page-hero-grid { grid-template-columns: 1fr; gap: 58px; }
  .hero-copy { text-align: center; }
  .hero-copy h1, .hero-copy .lead { margin-inline: auto; }
  .hero-actions, .hero-note { justify-content: center; }
  .product-stage { width: min(650px, 92%); margin-inline: auto; }
  .split, .split.reverse, .feature-band { grid-template-columns: 1fr; gap: 44px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pilot-layout { grid-template-columns: 1fr; }
  .pilot-side { position: static; }
  .login-page { grid-template-columns: 1fr; }
  .login-story { min-height: 520px; }
  .footer-grid { grid-template-columns: 1.3fr repeat(3, 1fr); gap: 28px; }
}

@media (max-width: 760px) {
  body.site-surface { --header-h: 68px; }
  .container, .container-narrow { width: min(100% - 28px, var(--container)); }
  .section { padding: 68px 0; }
  .section-sm { padding: 50px 0; }
  .header-inner { width: calc(100% - 24px); gap: 10px; }
  .brand img { width: 34px; height: 34px; }
  .brand-word { font-size: 1.18rem; }
  .header-actions { margin-left: auto; }
  .header-actions .btn-secondary { min-height: 40px; padding: 0 12px; font-size: .84rem; }
  .menu-toggle { margin-left: 0; width: 40px; height: 40px; }
  .mobile-nav { width: calc(100% - 24px); }
  .hero { padding: 58px 0 68px; }
  .hero-copy h1 { font-size: clamp(2.48rem, 13.2vw, 4rem); }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .hero-note { align-items: flex-start; text-align: left; }
  .product-stage { width: 100%; }
  .product-stage::before { inset: -12px -8px -14px; border-radius: 25px; }
  .app-layout { grid-template-columns: 78px 1fr; min-height: 370px; }
  .app-sidebar { padding: 12px 7px; }
  .app-logo-mini span { display: none; }
  .app-nav-item { justify-content: center; padding: 9px 4px; }
  .app-nav-item span { display: none; }
  .app-main { padding: 14px; }
  .insight-grid { grid-template-columns: 1fr; }
  .insight-card { min-height: auto; }
  .float-card { display: none; }
  .logo-strip-inner { flex-direction: column; gap: 12px; padding: 22px 0; }
  .grid-2, .grid-3, .grid-4, .security-grid, .metric-row { grid-template-columns: 1fr; }
  .story-head, .story-row { grid-template-columns: 1fr; }
  .story-head div:last-child { display: none; }
  .story-cell:first-child { border-right: 0; border-bottom: 1px dashed var(--line-strong); }
  .story-cell:last-child::before { content: "With InstInt"; display: inline-block; margin-bottom: 8px; color: var(--brand); font-size: .68rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
  .story-cell:last-child { display: block; }
  .story-cell:last-child svg { float: left; margin-right: 12px; }
  .callout { padding: 26px; }
  .callout-row { align-items: flex-start; flex-direction: column; }
  .page-hero { padding: 56px 0; }
  .page-hero h1 { font-size: clamp(2.35rem, 12vw, 3.75rem); }
  .page-hero-actions { display: grid; grid-template-columns: 1fr; }
  .page-hero-actions .btn { width: 100%; }
  .page-visual { padding: 16px; }
  .form-card { padding: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .cta-panel { align-items: stretch; flex-direction: column; padding: 30px 25px; }
  .cta-actions { min-width: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
  .login-story { min-height: auto; padding: 58px 25px; }
  .login-panel { padding: 46px 22px; }
  .login-links { flex-direction: column; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .modal-head, .modal-body { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 430px) {
  .header-actions .btn-secondary { padding-inline: 10px; }
  .header-actions .btn-secondary .desktop-label { display: none; }
  .hero-copy h1 { font-size: 2.45rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .mobile-actions { grid-template-columns: 1fr; }
}

/* Public dark-surface contrast: these scoped rules outrank the generic site typography layer. */
body.site-surface .btn.btn-primary,
body.site-surface a.btn.btn-primary {
  color: #ffffff;
}

body.site-surface .section-brand h1,
body.site-surface .section-brand h2,
body.site-surface .section-brand h3,
body.site-surface .section-brand h4,
body.site-surface .section-brand strong {
  color: #ffffff;
}

body.site-surface .section-brand p,
body.site-surface .section-brand li,
body.site-surface .section-brand .lead,
body.site-surface .section-brand .muted {
  color: #dfe6ff;
}

/* Final component refinements */
.answer-label svg { width: 14px; height: 14px; flex: 0 0 auto; }
.login-story .eyebrow { color: #cbd6ff; }

@media (max-width: 760px) {
  .login-panel { order: -1; }
  .login-story { order: 2; }
}

/* Staged staff sign-in */
.staged-login-form { margin-top: 0; }
.login-step[hidden] { display: none !important; }
.login-step.active { display: block; animation: loginStepIn .18s ease both; }
.login-step .login-context { margin: 0 0 18px; }
.login-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.login-actions .login-continue { flex: 1; }
.login-actions [data-login-back] { flex: 0 0 auto; }
@keyframes loginStepIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .login-step.active { animation: none; } }
@media (max-width: 430px) {
  .login-actions { align-items: stretch; flex-direction: column-reverse; }
  .login-actions .btn { width: 100%; }
}


/* Official InstInt branding */
.brand.brand-official {
  min-width: 0;
  gap: 0;
}
.brand.brand-official img {
  display: block;
  object-fit: contain;
}
.brand.brand-official .brand-logo-full {
  width: 154px;
  height: auto;
  max-height: 64px;
}
.brand.brand-official .brand-logo-icon {
  display: none;
  width: 30px;
  height: 46px;
}
.footer-brand .brand.brand-official .brand-logo-full {
  width: 198px;
  max-height: none;
}
.login-box .brand.brand-official .brand-logo-full {
  width: 190px;
  max-height: none;
}
.app-logo-mini img {
  object-fit: contain;
}
@media (max-width: 760px) {
  .site-header .brand.brand-official .brand-logo-full {
    display: none;
  }
  .site-header .brand.brand-official .brand-logo-icon {
    display: block;
    width: 25px;
    height: 42px;
  }
  .footer-brand .brand.brand-official .brand-logo-full,
  .login-box .brand.brand-official .brand-logo-full {
    display: block;
  }
  .footer-brand .brand.brand-official .brand-logo-icon,
  .login-box .brand.brand-official .brand-logo-icon {
    display: none;
  }
}


/* ==========================================================================
   Staff assistant
   Source: styles-src/20-staff.css
   ========================================================================== */
body.staff-surface {
  --staff-bg: #f5f7fb;
  --staff-surface: #ffffff;
  --staff-ink: #172033;
  --staff-muted: #667085;
  --staff-line: #dfe4ee;
  --staff-brand: #4656a6;
  --staff-brand-dark: #303d83;
  --staff-brand-soft: #eef0fb;
  --staff-success: #217a53;
  --staff-danger: #a33245;
  --staff-shadow: 0 18px 48px rgba(29, 39, 69, .10);
}
body.staff-surface,
body.staff-surface * { box-sizing: border-box; }
body.staff-surface { margin: 0; min-width: 320px; min-height: 100vh; color: var(--staff-ink); background: var(--staff-bg); font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif; }
body.staff-surface button, body.staff-surface textarea { font: inherit; }
body.staff-surface button { cursor: pointer; }
.staff-shell { min-height: 100vh; }
.staff-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(210, 217, 231, .88); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); }
.staff-header-inner { width: min(1180px, calc(100% - 36px)); min-height: 72px; margin: 0 auto; display: flex; align-items: center; gap: 18px; }
.staff-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--staff-ink); font-weight: 760; font-size: 1.18rem; text-decoration: none; }
.staff-brand img { width: 36px; height: 36px; }
.staff-context { min-width: 0; margin-right: auto; padding-left: 18px; border-left: 1px solid var(--staff-line); }
.staff-context strong, .staff-context span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-context strong { font-size: .92rem; }
.staff-context span { margin-top: 2px; color: var(--staff-muted); font-size: .76rem; }
.staff-header-actions { display: flex; align-items: center; gap: 8px; }
.staff-button { min-height: 40px; padding: 0 14px; border: 1px solid var(--staff-line); border-radius: 10px; color: var(--staff-ink); background: #fff; font-weight: 680; }
.staff-button:hover { background: #f8f9fc; }
.staff-button.primary { border-color: var(--staff-brand); color: #fff; background: var(--staff-brand); }
.staff-button.primary:hover { background: var(--staff-brand-dark); }
.staff-button[disabled] { cursor: wait; opacity: .65; }
.staff-main { width: min(980px, calc(100% - 36px)); margin: 0 auto; padding: 56px 0 72px; }
.staff-intro { text-align: center; }
.staff-kicker { display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px; border: 1px solid #d8dced; border-radius: 999px; color: var(--staff-brand-dark); background: var(--staff-brand-soft); font-size: .72rem; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.staff-intro h1 { max-width: 760px; margin: 18px auto 0; font-size: clamp(2.25rem, 7vw, 4.6rem); line-height: .98; letter-spacing: -.055em; }
.staff-intro p { max-width: 660px; margin: 18px auto 0; color: var(--staff-muted); font-size: 1.05rem; line-height: 1.65; }
.ask-card { margin-top: 34px; padding: 22px; border: 1px solid var(--staff-line); border-radius: 20px; background: var(--staff-surface); box-shadow: var(--staff-shadow); }
.ask-card label { display: block; margin-bottom: 9px; font-size: .82rem; font-weight: 730; }
.ask-input { width: 100%; min-height: 132px; resize: vertical; padding: 17px 18px; border: 1px solid #cfd6e4; border-radius: 14px; color: var(--staff-ink); background: #fbfcfe; font-size: 1rem; line-height: 1.55; outline: none; }
.ask-input:focus { border-color: var(--staff-brand); box-shadow: 0 0 0 4px rgba(70, 86, 166, .12); background: #fff; }
.ask-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }
.ask-hint { color: var(--staff-muted); font-size: .78rem; }
.ask-submit { min-height: 46px; padding: 0 20px; border: 0; border-radius: 11px; color: #fff; background: var(--staff-brand); font-weight: 740; }
.ask-submit:hover { background: var(--staff-brand-dark); }
.ask-submit[disabled] { cursor: wait; opacity: .68; }
.top-questions { margin-top: 22px; }
.top-questions-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-questions h2 { margin: 0; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }
.top-questions-note { color: var(--staff-muted); font-size: .74rem; }
.question-pills { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.question-pill { min-height: 52px; padding: 11px 13px; border: 1px solid var(--staff-line); border-radius: 12px; color: var(--staff-ink); background: #fff; text-align: left; line-height: 1.35; }
.question-pill:hover { border-color: #bcc5dc; background: var(--staff-brand-soft); }
.answer-panel { display: none; margin-top: 28px; border: 1px solid var(--staff-line); border-radius: 20px; background: #fff; box-shadow: var(--staff-shadow); overflow: hidden; }
.answer-panel.show { display: block; }
.answer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--staff-line); background: #fafbfe; }
.answer-head h2 { margin: 4px 0 0; font-size: 1.2rem; }
.answer-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.answer-badge { display: inline-flex; min-height: 27px; align-items: center; padding: 0 9px; border: 1px solid #d6dbea; border-radius: 999px; color: var(--staff-brand-dark); background: var(--staff-brand-soft); font-size: .68rem; font-weight: 760; }
.answer-body { padding: 24px 22px 26px; }
.answer-main { margin: 0; color: var(--staff-ink); font-size: clamp(1.14rem, 2.4vw, 1.48rem); font-weight: 700; line-height: 1.45; }
.answer-details { display: grid; gap: 9px; margin: 18px 0 0; padding: 0; list-style: none; }
.answer-details li { position: relative; padding-left: 21px; color: #384258; line-height: 1.58; }
.answer-details li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 7px; height: 7px; border-radius: 50%; background: var(--staff-brand); }
.answer-expand { margin-top: 22px; border: 1px solid var(--staff-line); border-radius: 13px; overflow: hidden; }
.answer-expand summary { padding: 14px 15px; color: var(--staff-brand-dark); background: #fafbfe; font-weight: 720; cursor: pointer; }
.answer-expand-content { padding: 16px; border-top: 1px solid var(--staff-line); }
.source-list { display: grid; gap: 12px; }
.source-card { padding: 14px; border: 1px solid var(--staff-line); border-radius: 11px; background: #fff; }
.source-card strong { display: block; }
.source-card small { display: block; margin-top: 3px; color: var(--staff-muted); }
.source-card p { margin: 10px 0 0; color: #475169; line-height: 1.55; white-space: pre-wrap; }
.answer-feedback { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--staff-line); }
.answer-feedback span { margin-right: 4px; color: var(--staff-muted); font-size: .82rem; }
.feedback-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--staff-line); border-radius: 9px; color: var(--staff-ink); background: #fff; font-weight: 680; }
.feedback-button:hover { background: var(--staff-brand-soft); }
.staff-status { display: none; margin-top: 18px; padding: 12px 14px; border-radius: 10px; font-size: .86rem; }
.staff-status.show { display: block; }
.staff-status.info { color: var(--staff-brand-dark); background: var(--staff-brand-soft); }
.staff-status.error { color: var(--staff-danger); background: #fff0f2; }
.staff-empty { color: var(--staff-muted); }
@media (max-width: 760px) {
  .staff-header-inner { width: calc(100% - 24px); min-height: 66px; gap: 10px; }
  .staff-context { padding-left: 10px; }
  .staff-context strong { font-size: .82rem; }
  .staff-context span { font-size: .7rem; }
  .staff-button { padding: 0 10px; }
  .staff-button.history { display: none; }
  .staff-main { width: calc(100% - 24px); padding: 38px 0 54px; }
  .staff-intro { text-align: left; }
  .staff-intro h1 { font-size: clamp(2.35rem, 13vw, 3.65rem); }
  .staff-intro p { font-size: .96rem; }
  .ask-card { margin-top: 26px; padding: 16px; border-radius: 16px; }
  .ask-input { min-height: 116px; }
  .ask-actions { align-items: stretch; flex-direction: column; }
  .ask-submit { width: 100%; }
  .question-pills { grid-template-columns: 1fr; }
  .answer-head { flex-direction: column; }
  .answer-badges { justify-content: flex-start; }
  .answer-body { padding: 20px 17px 22px; }
}
@media (max-width: 430px) {
  .staff-brand span { display: none; }
  .staff-header-actions { gap: 5px; }
  .staff-button { font-size: .78rem; }
}


/* Minimal mobile staff question view */
.staff-brand img {
  object-fit: contain;
}
@media (max-width: 760px) {
  .staff-header-inner {
    width: calc(100% - 20px);
    min-height: 56px;
  }
  .staff-brand {
    gap: 0;
  }
  .staff-brand img {
    width: 24px;
    height: 38px;
  }
  .staff-brand span,
  .staff-context {
    display: none;
  }
  .staff-header-actions {
    margin-left: auto;
  }
  .staff-button {
    min-height: 34px;
    padding: 0 10px;
    border-color: transparent;
    background: transparent;
    color: var(--staff-muted);
    font-size: .75rem;
  }
  .staff-button:hover {
    background: #f4f6fa;
  }
  .staff-main {
    width: calc(100% - 24px);
    padding: 22px 0 42px;
  }
  .staff-intro {
    text-align: left;
  }
  .staff-intro h1 {
    max-width: none;
    margin: 0;
    color: #4f586b;
    font-size: clamp(1.22rem, 5.8vw, 1.55rem);
    font-weight: 620;
    line-height: 1.28;
    letter-spacing: -.025em;
  }
  .ask-card {
    margin-top: 16px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .ask-card label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .ask-input {
    min-height: 96px;
    padding: 14px 15px;
    resize: none;
    border-radius: 13px;
    background: #fff;
    font-size: .98rem;
  }
  .ask-actions {
    margin-top: 10px;
  }
  .ask-hint {
    display: none;
  }
  .ask-submit {
    min-height: 43px;
    width: 100%;
  }
  .top-questions {
    margin-top: 20px;
  }
  .top-questions-head {
    min-height: 24px;
  }
  .top-questions h2 {
    color: #5e6678;
    font-size: .75rem;
  }
  .question-pills {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
  }
  .question-pill {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: .9rem;
  }
  .staff-status {
    margin-top: 12px;
  }
  .answer-panel {
    margin-top: 18px;
    border-radius: 15px;
  }
}
.source-card.has-answer-evidence {
  border-color: #d7c36a;
  box-shadow: 0 0 0 3px rgba(245, 207, 74, 0.12);
}

.source-evidence-highlight {
  margin: 0 -1px;
  padding: 1px 2px;
  border-radius: 3px;
  color: inherit;
  background: #ffe97a;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  box-shadow: inset 0 -1px 0 rgba(147, 113, 0, 0.18);
}


/* ==========================================================================
   Administration shell and components
   Source: styles-src/30-admin.css
   ========================================================================== */
body.admin-aaa-body {
  --aaa-bg: #04071c;
  --aaa-bg-2: #071135;
  --aaa-ink: #f8fbff;
  --aaa-ink-soft: rgba(248, 251, 255, 0.78);
  --aaa-muted: rgba(219, 227, 255, 0.68);
  --aaa-line: rgba(167, 184, 255, 0.34);
  --aaa-line-strong: rgba(202, 213, 255, 0.52);
  --aaa-blue: #1c77ff;
  --aaa-cyan: #18c4ff;
  --aaa-violet: #7c35ff;
  --aaa-magenta: #c73cff;
  --aaa-green: #29d98b;
  --aaa-danger: #ff4776;
  --aaa-panel: rgba(8, 13, 42, 0.56);
  --aaa-frost: rgba(238, 244, 255, 0.17);
  --aaa-frost-light: rgba(246, 249, 255, 0.22);
}

* { box-sizing: border-box; }

body.admin-aaa-body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--aaa-ink);
  background:
    radial-gradient(circle at 82% 14%, rgba(147, 54, 255, 0.34), transparent 26%),
    radial-gradient(circle at 45% 58%, rgba(19, 101, 255, 0.24), transparent 30%),
    linear-gradient(135deg, #030617 0%, #071138 45%, #05061b 100%);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

body.admin-aaa-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 5, 20, 0.2), rgba(2, 5, 20, 0.72)),
    url("/instint-swoop-bg.svg") center / cover no-repeat;
  opacity: 0.98;
}

body.admin-aaa-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 58% 40%, black 0 35%, transparent 78%);
  opacity: 0.28;
}

.admin-aaa-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  background: transparent;
}

.aaa-sidebar {
  position: sticky;
  top: 0;
  width: 142px;
  min-width: 142px;
  height: 100vh;
  padding: 18px 12px;
  background:
    linear-gradient(180deg, rgba(7, 13, 40, 0.88), rgba(3, 7, 25, 0.88));
  border-right: 1px solid rgba(132, 157, 255, 0.24);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.aaa-logo-link {
  height: 86px;
  display: grid;
  place-items: center;
  text-decoration: none;
  border-bottom: 1px solid rgba(205, 216, 255, 0.16);
  padding-bottom: 16px;
}

.aaa-lightning-logo {
  width: 52px;
  height: 68px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 12px rgba(31, 119, 255, 0.7))
    drop-shadow(0 0 22px rgba(155, 56, 255, 0.55));
}

.aaa-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.aaa-nav-link,
.sidebar-bottom-link.aaa-nav-link {
  position: relative;
  min-height: 76px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(244, 248, 255, 0.88);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
}

.aaa-nav-link svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px rgba(46, 113, 255, 0.08));
}

.aaa-nav-link:hover {
  transform: translateY(-1px);
  background: rgba(79, 92, 255, 0.12);
  color: #fff;
}

.aaa-nav-link.active {
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(24, 196, 255, 0.38), transparent 34%),
    linear-gradient(135deg, rgba(28, 119, 255, 0.78), rgba(124, 53, 255, 0.72));
  box-shadow:
    0 0 0 1px rgba(179, 200, 255, 0.14) inset,
    0 12px 34px rgba(58, 74, 255, 0.28),
    0 0 34px rgba(156, 52, 255, 0.28);
}

.aaa-nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #19c8ff, #bf39ff);
  box-shadow: 0 0 18px rgba(93, 99, 255, 0.9);
}

.aaa-admin-link {
  margin-top: auto;
  border-top: 1px solid rgba(205, 216, 255, 0.16);
  padding-top: 18px;
  border-radius: 0;
}

.aaa-main-shell {
  min-width: 0;
  flex: 1;
  background: transparent;
}

.aaa-topbar {
  height: 78px;
  padding: 0 34px;
  background: rgba(5, 9, 31, 0.68);
  border-bottom: 1px solid rgba(132, 157, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.aaa-topbar-brand,
.aaa-topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.aaa-topbar-logo {
  width: 24px;
  height: 34px;
  filter: drop-shadow(0 0 12px rgba(141, 63, 255, 0.75));
}

.aaa-topbar-brand strong {
  font-size: 27px;
  letter-spacing: -0.04em;
}

.aaa-topbar-divider {
  width: 1px;
  height: 34px;
  background: rgba(193, 206, 255, 0.22);
}

.aaa-topbar-title,
.topbar-title.aaa-topbar-title {
  color: var(--aaa-ink);
  font-size: 18px;
  font-weight: 700;
}

.aaa-crown {
  width: 28px;
  height: 28px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  color: #8bbcff;
  background: rgba(34, 86, 255, 0.28);
  box-shadow: 0 0 18px rgba(62, 88, 255, 0.22);
}

.aaa-top-add,
.primary-btn.aaa-top-add {
  height: 48px;
  padding: 0 26px;
  border-radius: 14px;
  background: linear-gradient(100deg, #166fff, #5c55ff 52%, #bd35ff);
  box-shadow: 0 16px 34px rgba(23, 105, 255, 0.25), 0 0 28px rgba(190, 55, 255, 0.24);
  color: #fff;
  font-weight: 700;
}

.aaa-icon-top {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  border: 1px solid rgba(171, 190, 255, 0.28);
  background: rgba(7, 11, 35, 0.42);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.aaa-icon-top svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aaa-avatar {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  border: 1px solid rgba(171, 190, 255, 0.34);
  background: rgba(238, 244, 255, 0.10);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
}

.aaa-avatar span {
  position: absolute;
  right: 3px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--aaa-green);
  box-shadow: 0 0 10px rgba(41, 217, 139, 0.7);
}

.aaa-content-shell {
  display: block;
  min-height: calc(100vh - 78px);
  background: transparent;
}

.aaa-content-area {
  position: relative;
  padding: 36px 42px 52px;
  color: var(--aaa-ink);
}

.aaa-content-header {
  margin-bottom: 26px;
  align-items: center;
}

.aaa-content-header > div {
  position: relative;
  padding-left: 28px;
}

.aaa-content-header > div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--aaa-blue), var(--aaa-magenta));
  box-shadow: 0 0 20px rgba(124, 53, 255, 0.65);
}

.aaa-content-header h1,
.content-header.aaa-content-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.055em;
  line-height: 1.02;
  text-shadow: 0 0 26px rgba(93, 121, 255, 0.16);
}

.aaa-content-header p,
.content-header.aaa-content-header p {
  color: var(--aaa-ink-soft);
  font-size: 17px;
  margin-top: 8px;
}

.aaa-hidden-source-btn { display: none !important; }

.aaa-filters-row,
.filters-row.aaa-filters-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr;
  gap: 22px;
  margin-bottom: 22px;
}

.aaa-control-wrap {
  position: relative;
}

.aaa-control-wrap input,
.aaa-control-wrap select,
.search-wrap.aaa-control-wrap input,
.filter-wrap.aaa-control-wrap select {
  width: 100%;
  height: 62px;
  padding: 0 52px;
  border: 1px solid var(--aaa-line);
  border-radius: 15px;
  color: #f7faff;
  font-size: 16px;
  font-weight: 700;
  outline: none;
  background: rgba(11, 17, 51, 0.58);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.025) inset, 0 14px 42px rgba(0,0,0,0.16);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.aaa-control-wrap input::placeholder { color: rgba(244, 248, 255, 0.70); }
.aaa-control-wrap select { appearance: none; -webkit-appearance: none; }

.aaa-control-wrap input:focus,
.aaa-control-wrap select:focus {
  border-color: rgba(62, 168, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(40, 113, 255, 0.14), 0 0 34px rgba(141, 59, 255, 0.20);
}

.aaa-control-icon {
  position: absolute;
  z-index: 2;
  left: 22px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  fill: none;
  stroke: #31a7ff;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px rgba(49, 167, 255, 0.55));
  pointer-events: none;
}

.aaa-control-wrap::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(244, 248, 255, 0.86);
  border-bottom: 2px solid rgba(244, 248, 255, 0.86);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.aaa-search-control::after { display: none; }

.aaa-shortcut {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(238, 244, 255, 0.12);
  border: 1px solid rgba(238, 244, 255, 0.12);
  color: rgba(248, 251, 255, 0.76);
  font-weight: 600;
}

.aaa-association-manager,
.association-manager.aaa-association-manager {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 22px 26px;
  border: 1px solid var(--aaa-line-strong);
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, rgba(238, 244, 255, 0.20), rgba(238, 244, 255, 0.10));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.20), 0 0 0 1px rgba(255,255,255,.035) inset;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  overflow: hidden;
}

.aaa-association-manager::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(31, 119, 255, .22), transparent 28%),
    radial-gradient(circle at 92% 10%, rgba(194, 60, 255, .22), transparent 30%);
  pointer-events: none;
}

.aaa-section-icon,
.aaa-section-copy,
.aaa-manage-btn { position: relative; z-index: 1; }

.aaa-section-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--aaa-blue), var(--aaa-violet));
  box-shadow: 0 0 30px rgba(95, 74, 255, 0.35);
}

.aaa-section-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aaa-association-manager h2,
.association-manager.aaa-association-manager h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.aaa-association-manager p,
.association-manager.aaa-association-manager p {
  color: var(--aaa-ink-soft);
  margin: 5px 0 14px;
}

.aaa-association-list,
.association-list.aaa-association-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #fff;
}

.aaa-association-list .association-row,
.association-list.aaa-association-list .association-row {
  display: inline-flex;
  width: auto;
  justify-content: flex-start;
  background: rgba(238, 244, 255, 0.11);
  border: 1px solid rgba(238, 244, 255, 0.16);
  color: #fff;
  border-radius: 999px;
  padding: 9px 13px;
}

.aaa-association-list .remove-association-btn { display: none; }

.aaa-manage-btn,
.secondary-btn.aaa-manage-btn {
  height: 48px;
  padding: 0 20px;
  color: #fff;
  border: 1px solid rgba(188, 84, 255, 0.62);
  background: rgba(126, 53, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 0 24px rgba(175, 54, 255, 0.14);
}

.aaa-knowledge-grid,
.knowledge-grid.aaa-knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.aaa-knowledge-grid .knowledge-card,
.knowledge-grid.aaa-knowledge-grid .knowledge-card {
  position: relative;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(245, 248, 255, 0.22), rgba(229, 237, 255, 0.11));
  border: 1px solid rgba(223, 232, 255, 0.52);
  box-shadow:
    0 18px 52px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,255,255,0.035) inset;
  backdrop-filter: blur(22px) saturate(156%);
  -webkit-backdrop-filter: blur(22px) saturate(156%);
  overflow: hidden;
}

.aaa-knowledge-grid .knowledge-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.26), transparent 28%),
    radial-gradient(circle at 92% 18%, rgba(158, 74, 255, 0.18), transparent 36%);
  opacity: 0.82;
  pointer-events: none;
}

.aaa-knowledge-grid .knowledge-card > * { position: relative; z-index: 1; }

.aaa-knowledge-grid .card-top-row { margin-bottom: 18px; }

.aaa-knowledge-grid .category-badge,
.aaa-knowledge-grid .status-badge {
  border-radius: 999px;
  padding: 8px 13px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  background: rgba(42, 104, 255, 0.36);
  border: 1px solid rgba(134, 167, 255, 0.22);
  box-shadow: 0 0 18px rgba(35, 93, 255, 0.16);
}

.aaa-knowledge-grid .cat-services,
.aaa-knowledge-grid .cat-overview { background: rgba(126, 53, 255, 0.38); }
.aaa-knowledge-grid .cat-parking { background: rgba(26, 117, 255, 0.38); }

.aaa-knowledge-grid .status-active,
.aaa-knowledge-grid .status-badge.status-active {
  color: #caffea;
  background: rgba(41, 217, 139, 0.16);
  border-color: rgba(41, 217, 139, 0.28);
}

.aaa-knowledge-grid .status-active::before {
  content: "✓";
  margin-right: 6px;
  color: var(--aaa-green);
}

.aaa-knowledge-grid .card-title,
.knowledge-grid.aaa-knowledge-grid .card-title {
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 10px;
}

.aaa-knowledge-grid .card-content,
.knowledge-grid.aaa-knowledge-grid .card-content {
  color: rgba(248, 251, 255, 0.88);
  line-height: 1.52;
  font-size: 15.5px;
}

.aaa-knowledge-grid .card-divider {
  margin-top: auto;
  background: rgba(223, 232, 255, 0.15);
}

.aaa-knowledge-grid .card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.aaa-knowledge-grid .card-btn,
.aaa-knowledge-grid .edit-btn,
.aaa-knowledge-grid .delete-btn {
  border-radius: 11px;
  padding: 9px 14px;
  font-weight: 700;
  background: rgba(12, 23, 69, 0.30);
  backdrop-filter: blur(10px);
}

.aaa-knowledge-grid .edit-btn {
  color: #6bb8ff;
  border: 1px solid rgba(35, 125, 255, 0.58);
}

.aaa-knowledge-grid .delete-btn {
  color: #ff5d82;
  border: 1px solid rgba(255, 71, 118, 0.46);
}

.aaa-editor-panel,
.knowledge-editor-panel.aaa-editor-panel {
  color: #0c1430;
}

.aaa-editor-panel > .panel-header,
.aaa-editor-panel > .panel-body,
.aaa-duplicate-overlay .duplicate-modal {
  background: rgba(247, 250, 255, 0.9);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

@media (max-width: 1220px) {
  .aaa-knowledge-grid,
  .knowledge-grid.aaa-knowledge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aaa-filters-row,
  .filters-row.aaa-filters-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .admin-aaa-shell { flex-direction: column; }
  .aaa-sidebar {
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .aaa-logo-link { height: 64px; min-width: 78px; border-bottom: 0; padding-bottom: 0; }
  .aaa-lightning-logo { width: 34px; height: 48px; }
  .aaa-sidebar-nav { flex-direction: row; }
  .aaa-nav-link { min-width: 86px; min-height: 62px; }
  .aaa-admin-link { margin-top: 0; border-top: 0; min-width: 86px; }
  .aaa-topbar { padding: 0 18px; }
  .aaa-topbar-brand strong,
  .aaa-topbar-divider,
  .aaa-crown { display: none; }
  .aaa-content-area { padding: 24px 16px 34px; }
  .aaa-association-manager { grid-template-columns: 1fr; }
  .aaa-knowledge-grid,
  .knowledge-grid.aaa-knowledge-grid { grid-template-columns: 1fr; }
}

/* 2026-08-26 unified application presentation fixes */
@media (min-width: 901px) {
  .admin-aaa-body .aaa-sidebar,
  .admin-aaa-body aside.aaa-sidebar {
    position: relative !important;
    inset: auto !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
    align-self: stretch !important;
  }
}

.admin-aaa-body .aaa-content-area,
.admin-aaa-body .content-area.aaa-content-area,
.admin-aaa-body .feedback-aaa-content {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
}

.admin-aaa-body select,
.admin-aaa-body select option,
.admin-aaa-body .aaa-themed-select,
.admin-aaa-body .aaa-themed-select option {
  color: #202638 !important;
  background: #ffffff !important;
}

.admin-aaa-body .status-message.error,
.admin-aaa-body .roles-status.error,
.admin-aaa-body .role-panel-status.error,
.admin-aaa-body .security-status.error,
.admin-aaa-body .login-status.error {
  color: #8a1728 !important;
  background: #ffeaee !important;
  border-color: #e9aab5 !important;
}

.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card {
  color: #ffffff !important;
  background: linear-gradient(145deg, #17224a 0%, #0b1232 100%) !important;
  border-color: #344477 !important;
}

.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card-copy strong,
.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card-copy > span,
.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card-chevron {
  color: #ffffff !important;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card {
  color: #242a3c !important;
  background: linear-gradient(145deg, #ffffff 0%, #f8f6ff 100%) !important;
  border: 2px solid #7657ed !important;
  box-shadow: 0 18px 42px rgba(95, 66, 212, 0.20) !important;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-copy strong,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-copy > span,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-chevron {
  color: #34246f !important;
}

.admin-aaa-body .aaa-category-open-indicator {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  gap: 7px;
  margin-top: 12px !important;
  padding: 7px 10px;
  border-radius: 999px;
  color: #ffffff !important;
  background: #6b4de6;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-count {
  color: #ffffff !important;
  background: #6b4de6 !important;
  border-color: #6b4de6 !important;
}

.admin-aaa-body .import-draft-content,
.admin-aaa-body .aaa-category-card-preview {
  max-height: none !important;
  overflow: visible !important;
  mask-image: none !important;
}

.admin-aaa-body .import-draft-card .card-actions {
  flex-wrap: wrap;
}

.admin-aaa-body .auto-improve-draft-btn {
  color: #ffffff !important;
  background: linear-gradient(180deg, #7657ed, #6245dc) !important;
  border-color: transparent !important;
}


/* Shared AAA page overrides for SaaS, Support, Imports, Recycle Bin, and Billing */
.admin-aaa-body .aaa-summary-grid,
.admin-aaa-body .analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.admin-aaa-body .summary-card {
  min-height: 142px;
  border: 1px solid rgba(223, 232, 255, 0.46);
  border-radius: 20px;
  padding: 22px 18px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(47, 151, 255, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(245, 248, 255, 0.20), rgba(229, 237, 255, 0.10));
  box-shadow:
    0 18px 52px rgba(0,0,0,0.20),
    0 0 0 1px rgba(255,255,255,0.035) inset;
  backdrop-filter: blur(22px) saturate(156%);
  -webkit-backdrop-filter: blur(22px) saturate(156%);
}

.admin-aaa-body .summary-card span,
.admin-aaa-body .summary-card small,
.admin-aaa-body .summary-card .summary-card-note {
  color: rgba(238, 244, 255, 0.68);
}

.admin-aaa-body .summary-card strong {
  color: #fff;
  font-size: clamp(24px, 3vw, 36px);
  text-shadow: 0 0 22px rgba(56, 132, 255, 0.20);
}

.admin-aaa-body .summary-card.danger strong,
.admin-aaa-body .summary-card.warning strong {
  color: #ff9ab2;
}

.admin-aaa-body .aaa-analytics-grid,
.admin-aaa-body .analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.admin-aaa-body .aaa-analytics-panel,
.admin-aaa-body .analytics-panel,
.admin-aaa-body .import-bulk-toolbar,
.admin-aaa-body .support-snapshot-box {
  position: relative;
  border: 1px solid rgba(223, 232, 255, 0.46);
  border-radius: 20px;
  padding: 22px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(245, 248, 255, 0.18), rgba(229, 237, 255, 0.09));
  box-shadow:
    0 18px 52px rgba(0,0,0,0.20),
    0 0 0 1px rgba(255,255,255,0.035) inset;
  backdrop-filter: blur(22px) saturate(156%);
  -webkit-backdrop-filter: blur(22px) saturate(156%);
}

.admin-aaa-body .analytics-panel-header h2,
.admin-aaa-body .import-hero-card h2,
.admin-aaa-body .support-faq-card summary {
  color: #fff;
}

.admin-aaa-body .analytics-panel-header p,
.admin-aaa-body .import-hero-card p,
.admin-aaa-body .support-faq-card p,
.admin-aaa-body .support-snapshot-box span,
.admin-aaa-body .import-meta,
.admin-aaa-body .recycle-meta {
  color: rgba(248, 251, 255, 0.74);
}

.admin-aaa-body .analytics-row,
.admin-aaa-body .support-faq-card,
.admin-aaa-body .latest-feedback,
.admin-aaa-body .feedback-metrics div {
  background: rgba(238, 244, 255, 0.10);
  border: 1px solid rgba(238, 244, 255, 0.14);
  border-radius: 15px;
  color: #fff;
}

.admin-aaa-body .analytics-row strong,
.admin-aaa-body .analytics-row span,
.admin-aaa-body .latest-feedback p,
.admin-aaa-body .feedback-meta-row,
.admin-aaa-body .topic-label,
.admin-aaa-body .feedback-metrics span,
.admin-aaa-body .feedback-metrics strong {
  color: rgba(248, 251, 255, 0.86);
}

.admin-aaa-body .analytics-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-aaa-body .analytics-row {
  padding: 14px 16px;
}

.admin-aaa-body .analytics-row-stat {
  color: #63d8ff;
}

.admin-aaa-body .primary-btn,
.admin-aaa-body .secondary-btn,
.admin-aaa-body .card-btn,
.admin-aaa-body .browse-file-btn,
.admin-aaa-body .danger-outline-btn {
  border-radius: 14px;
  font-weight: 700;
}

.admin-aaa-body .primary-btn,
.admin-aaa-body .browse-file-btn {
  background: linear-gradient(100deg, #166fff, #5c55ff 52%, #bd35ff);
  color: #fff;
  border: 1px solid rgba(203, 217, 255, 0.22);
  box-shadow: 0 16px 34px rgba(23, 105, 255, 0.21), 0 0 28px rgba(190, 55, 255, 0.18);
}

.admin-aaa-body .secondary-btn,
.admin-aaa-body .card-btn,
.admin-aaa-body .danger-outline-btn {
  background: rgba(238, 244, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(238, 244, 255, 0.18);
}

.admin-aaa-body .delete-btn,
.admin-aaa-body .danger-outline-btn {
  color: #ffd0db;
  border-color: rgba(255, 71, 118, 0.38);
  background: rgba(255, 71, 118, 0.12);
}

.admin-aaa-body .field-label {
  color: rgba(248, 251, 255, 0.86);
}

.admin-aaa-body input,
.admin-aaa-body textarea,
.admin-aaa-body select,
.admin-aaa-body .support-form input,
.admin-aaa-body .support-form textarea,
.admin-aaa-body .support-form select,
.admin-aaa-body .import-field input,
.admin-aaa-body .import-field select,
.admin-aaa-body .wage-input-wrap {
  border: 1px solid var(--aaa-line);
  border-radius: 15px;
  color: #f7faff;
  background: rgba(11, 17, 51, 0.58);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.025) inset, 0 14px 42px rgba(0,0,0,0.16);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.admin-aaa-body input::placeholder,
.admin-aaa-body textarea::placeholder {
  color: rgba(244, 248, 255, 0.58);
}

.admin-aaa-body select option {
  color: #111827;
}

.admin-aaa-body .aaa-import-hero-card,
.admin-aaa-body .import-hero-card {
  max-width: none;
  border: 1px solid var(--aaa-line-strong);
  border-radius: 22px;
  padding: 26px;
  margin-bottom: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 20%, rgba(31, 119, 255, .22), transparent 28%),
    radial-gradient(circle at 92% 10%, rgba(194, 60, 255, .22), transparent 30%),
    linear-gradient(135deg, rgba(238, 244, 255, 0.20), rgba(238, 244, 255, 0.10));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.20), 0 0 0 1px rgba(255,255,255,.035) inset;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.admin-aaa-body .import-icon {
  background: linear-gradient(135deg, var(--aaa-blue), var(--aaa-violet));
  box-shadow: 0 0 30px rgba(95, 74, 255, 0.35);
}

.admin-aaa-body .file-drop-zone {
  border: 1px dashed rgba(147, 197, 253, 0.62);
  background: rgba(238, 244, 255, 0.08);
}

.admin-aaa-body .file-drop-copy strong,
.admin-aaa-body .selected-file-name {
  color: #fff;
}

.admin-aaa-body .file-drop-copy span {
  color: rgba(248, 251, 255, 0.68);
}

.admin-aaa-body .draft-count-pill {
  background: rgba(238, 244, 255, 0.12);
  border: 1px solid rgba(238, 244, 255, 0.20);
  color: #fff;
}

.admin-aaa-body .draft-count-pill span {
  background: linear-gradient(100deg, #166fff, #5c55ff 52%, #bd35ff);
  color: #fff;
}

.admin-aaa-body .draft-count-pill small,
.admin-aaa-body .selected-draft-count {
  color: rgba(248, 251, 255, 0.70);
}

.admin-aaa-body .draft-editor-panel .panel-shell,
.admin-aaa-body .duplicate-modal {
  color: #fff;
  background:
    linear-gradient(145deg, rgba(9, 15, 46, 0.96), rgba(4, 8, 30, 0.98));
  border: 1px solid rgba(223, 232, 255, 0.28);
}

.admin-aaa-body .draft-editor-panel .panel-header,
.admin-aaa-body .duplicate-header,
.admin-aaa-body .duplicate-actions {
  border-color: rgba(223, 232, 255, 0.16);
}

.admin-aaa-body .draft-editor-panel .panel-header h2,
.admin-aaa-body .duplicate-header h2,
.admin-aaa-body .duplicate-column h3,
.admin-aaa-body .duplicate-match-btn strong {
  color: #fff;
}

.admin-aaa-body .duplicate-header p,
.admin-aaa-body .duplicate-meta,
.admin-aaa-body .duplicate-match-btn span {
  color: rgba(248, 251, 255, 0.70);
}

.admin-aaa-body .duplicate-content,
.admin-aaa-body .duplicate-match-btn {
  color: rgba(248, 251, 255, 0.86);
  background: rgba(238, 244, 255, 0.10);
  border-color: rgba(238, 244, 255, 0.14);
}

.admin-aaa-body .support-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-aaa-body .support-faq-card {
  padding: 16px;
}

.admin-aaa-body .support-faq-card summary {
  cursor: pointer;
  font-weight: 700;
}

.admin-aaa-body .support-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-aaa-body .support-snapshot-box {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-aaa-body .billing-action-grid {
  display: grid;
  gap: 12px;
}

.admin-aaa-body .wage-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.admin-aaa-body .wage-input-wrap input {
  width: 96px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
}

.admin-aaa-body .deleted-entry-card {
  border-color: rgba(255, 71, 118, 0.32);
}

.admin-aaa-body .recycle-meta {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(238, 244, 255, 0.08);
  border: 1px solid rgba(238, 244, 255, 0.12);
  font-size: 13px;
  line-height: 1.5;
}

.admin-aaa-body .empty-state {
  background: rgba(238, 244, 255, 0.10);
  border: 1px dashed rgba(238, 244, 255, 0.24);
  color: rgba(248, 251, 255, 0.74);
}

@media (max-width: 1100px) {
  .admin-aaa-body .aaa-summary-grid,
  .admin-aaa-body .analytics-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-aaa-body .aaa-analytics-grid,
  .admin-aaa-body .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .aaa-sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    position: relative;
    flex-direction: row;
    overflow-x: auto;
  }
  .aaa-logo-link { min-width: 74px; height: 74px; border-bottom: 0; padding-bottom: 0; }
  .aaa-sidebar-nav { flex-direction: row; }
  .aaa-nav-link,
  .sidebar-bottom-link.aaa-nav-link { min-width: 84px; min-height: 66px; font-size: 11px; }
  .aaa-admin-link { margin-top: 0; border-top: 0; padding-top: 0; }
  .aaa-topbar { padding: 16px; height: auto; align-items: flex-start; gap: 14px; flex-direction: column; }
  .aaa-topbar-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .aaa-content-area { padding: 24px 18px 42px; }
  .admin-aaa-body .aaa-summary-grid,
  .admin-aaa-body .analytics-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Knowledge Manager group contrast, compact group headers, and bulk actions. */
.admin-aaa-body .aaa-knowledge-card-groups,
.admin-aaa-body .knowledge-grid.aaa-knowledge-card-groups {
  align-items: start !important;
}

.admin-aaa-body .aaa-category-card-grid-item,
.admin-aaa-body .aaa-category-card-grid-item.expanded {
  align-self: start !important;
  height: fit-content !important;
  min-height: 0 !important;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card {
  height: auto !important;
  min-height: 190px !important;
  grid-template-rows: auto auto !important;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-copy {
  align-self: start !important;
  width: 100%;
  margin-top: 2px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 13px;
  color: #ffffff !important;
  background: rgba(63, 39, 158, 0.86) !important;
  box-shadow: 0 8px 22px rgba(47, 30, 123, 0.18);
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-copy strong,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-copy > span,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-state-label,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-open-indicator {
  color: #ffffff !important;
  text-shadow: none !important;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-open-indicator {
  border-color: rgba(255, 255, 255, 0.54) !important;
  background: rgba(28, 17, 87, 0.46) !important;
}

.admin-aaa-body .aaa-knowledge-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #d8deea;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f7f5ff 100%);
  box-shadow: 0 8px 24px rgba(42, 50, 78, 0.06);
}

.admin-aaa-body .aaa-knowledge-bulk-summary {
  display: grid;
  gap: 3px;
  min-width: 175px;
}

.admin-aaa-body .aaa-knowledge-bulk-summary strong {
  color: #211a47 !important;
  font-size: 0.93rem;
}

.admin-aaa-body .aaa-knowledge-bulk-summary span {
  color: #647086 !important;
  font-size: 0.78rem;
  line-height: 1.35;
}

.admin-aaa-body .aaa-knowledge-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-aaa-body .aaa-knowledge-bulk-actions button {
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 750;
}

.admin-aaa-body .aaa-knowledge-bulk-actions button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-bulk-positive-btn:not(:disabled) {
  color: #075d45 !important;
  border-color: #9edcc8 !important;
  background: #ecfff8 !important;
}

.admin-aaa-body .aaa-knowledge-select-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #354056 !important;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-aaa-body .aaa-knowledge-select-control input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #6548dc;
}

.admin-aaa-body .card-top-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-aaa-body .knowledge-card.is-selected,
.admin-aaa-body .aaa-knowledge-grid .knowledge-card.is-selected {
  border: 2px solid #6b4de6 !important;
  box-shadow: 0 0 0 3px rgba(107, 77, 230, 0.12), 0 14px 34px rgba(31, 42, 74, 0.08) !important;
}

.admin-aaa-body .aaa-table-entry-row.is-selected {
  background: #f0edff !important;
  box-shadow: inset 4px 0 0 #6b4de6;
}

.admin-aaa-body .aaa-table-entry-category {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.admin-aaa-body .aaa-knowledge-table-select {
  flex: 0 0 auto;
  padding-top: 1px;
}

.admin-aaa-body .aaa-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 980px) {
  .admin-aaa-body .aaa-knowledge-bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-aaa-body .aaa-knowledge-bulk-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .admin-aaa-body .aaa-knowledge-bulk-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-aaa-body .aaa-knowledge-bulk-actions button {
    width: 100%;
  }

  .admin-aaa-body .aaa-category-card-grid-item .aaa-category-card,
  .admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card {
    min-height: 170px !important;
  }
}

/* R13: deliberate progress typography and Recycle Bin bulk controls. */
.admin-aaa-body .import-delete-progress-dialog {
  max-width: calc(100vw - 32px);
}

.admin-aaa-body .import-delete-progress-dialog h2 {
  max-width: 100%;
  margin-bottom: 16px;
  color: #171c2c !important;
  font-size: clamp(1.12rem, 4.2vw, 1.42rem);
  line-height: 1.18;
  letter-spacing: -0.018em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.admin-aaa-body .import-delete-progress-dialog p {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: #55617a !important;
  line-height: 1.42;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-aaa-body .aaa-recycle-bulk-toolbar {
  margin-top: 18px;
}

.admin-aaa-body .deleted-entry-card.is-selected {
  border: 2px solid #6b4de6 !important;
  box-shadow: 0 0 0 3px rgba(107, 77, 230, 0.12), 0 14px 34px rgba(31, 42, 74, 0.08) !important;
}

@media (max-width: 560px) {
  .admin-aaa-body .import-delete-progress-dialog {
    padding: 22px 20px;
    border-radius: 18px;
  }

  .admin-aaa-body .import-delete-progress-dialog h2 {
    font-size: 1.18rem;
  }
}

/* R31 duplicate review: fixed header/actions with a single scrollable review region. */
.admin-aaa-body #duplicateOverlay .duplicate-modal {
  height: min(92dvh, 920px) !important;
  max-height: calc(100dvh - 24px) !important;
  overflow: hidden !important;
}

.admin-aaa-body #duplicateOverlay .duplicate-header,
.admin-aaa-body #duplicateOverlay .duplicate-review-toolbar {
  flex: 0 0 auto !important;
}

.admin-aaa-body #duplicateOverlay .duplicate-review-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.admin-aaa-body #duplicateOverlay .duplicate-review-scroll > .duplicate-body {
  min-height: 360px;
  overflow: visible;
}

.admin-aaa-body #duplicateOverlay .duplicate-matches-rollup {
  margin: 0 22px 18px;
  border: 1px solid #d9ceff;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.admin-aaa-body #duplicateOverlay .duplicate-matches-rollup[hidden] {
  display: none !important;
}

.admin-aaa-body #duplicateOverlay .duplicate-matches-rollup > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #6047e8;
  background: #f0ecff;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  list-style: none;
  text-transform: uppercase;
  user-select: none;
}

.admin-aaa-body #duplicateOverlay .duplicate-matches-rollup > summary::-webkit-details-marker {
  display: none;
}

.admin-aaa-body #duplicateOverlay .duplicate-match-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid #cfc2ff;
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.72rem;
}

.admin-aaa-body #duplicateOverlay .duplicate-rollup-chevron {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.admin-aaa-body #duplicateOverlay .duplicate-matches-rollup[open] .duplicate-rollup-chevron {
  transform: rotate(180deg);
}

.admin-aaa-body #duplicateOverlay .duplicate-matches-rollup .duplicate-list {
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e6e0ff;
}

.admin-aaa-body #duplicateOverlay .duplicate-review-toolbar {
  position: relative !important;
  z-index: 5;
  margin: 0 !important;
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
}

/* R18: Import Draft review parity and record-safe deletion cancellation. */
.admin-aaa-body .bulk-progress-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.admin-aaa-body .bulk-progress-actions:has(.bulk-progress-cancel-btn[hidden]) {
  display: none;
}

.admin-aaa-body .bulk-progress-cancel-btn {
  min-height: 40px;
  padding: 0 16px;
  border-color: #c9cfe0 !important;
  color: #344054 !important;
  background: #ffffff !important;
  font-weight: 700;
}

.admin-aaa-body .bulk-progress-cancel-btn:hover:not(:disabled) {
  border-color: #7861df !important;
  color: #5035c7 !important;
  background: #f5f2ff !important;
}

.admin-aaa-body .import-draft-group-controls {
  margin-top: 0;
}

.admin-aaa-body .import-drafts-list.aaa-import-draft-groups {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 18px !important;
}

.admin-aaa-body .aaa-import-draft-groups .aaa-category-card-grid-item,
.admin-aaa-body .aaa-import-draft-groups .import-draft-card {
  align-self: start !important;
  min-width: 0;
}

.admin-aaa-body .aaa-import-draft-group-hint {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 0.78rem;
  font-weight: 650;
}

.admin-aaa-body .import-drafts-list.aaa-knowledge-table-view {
  display: block !important;
  width: 100%;
}

.admin-aaa-body .aaa-import-draft-table .aaa-knowledge-table-header,
.admin-aaa-body .aaa-import-draft-table .aaa-table-entry-row {
  grid-template-columns: minmax(210px, 0.95fr) minmax(150px, 0.7fr) minmax(190px, 0.9fr) minmax(270px, 1.35fr) 112px minmax(260px, 1fr) !important;
  min-width: 1260px;
}

.admin-aaa-body .aaa-table-entry-source {
  display: flex;
  align-self: start;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding-right: 12px;
  color: #344054;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.admin-aaa-body .import-draft-table-row.is-selected {
  box-shadow: inset 4px 0 0 #6b4de6;
  background: #f6f3ff !important;
}

.admin-aaa-body .import-draft-table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
}

.admin-aaa-body .import-draft-table-actions .aaa-table-action-btn {
  min-height: 30px;
  padding: 4px 8px;
}

.admin-aaa-body .import-draft-table-actions .delete-draft-btn {
  color: #b42318;
  border-color: #f0b9b3;
  background: #fff7f6;
}

@media (max-width: 1100px) {
  .admin-aaa-body .import-drafts-list.aaa-import-draft-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .admin-aaa-body .aaa-import-draft-groups .aaa-card-grid-filler {
    display: none !important;
  }
}

@media (max-width: 700px) {
  .admin-aaa-body .import-drafts-list.aaa-import-draft-groups {
    grid-template-columns: 1fr !important;
  }
}

/* R14: Created-date grouping and list sorting. */
.admin-aaa-body .aaa-knowledge-table-shell {
  overflow-x: auto !important;
}

.admin-aaa-body .aaa-knowledge-table-header,
.admin-aaa-body .aaa-table-entry-row {
  grid-template-columns: 190px minmax(175px, 0.85fr) minmax(250px, 1.55fr) 100px 108px 108px 72px !important;
  min-width: 1060px;
}

.admin-aaa-body .aaa-table-entry-created,
.admin-aaa-body .aaa-table-entry-updated {
  min-width: 0;
  overflow: hidden;
  align-self: start !important;
  padding-right: 14px;
  color: #667085 !important;
  font-weight: 600 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Final component states: deliberately last so page-specific legacy rules cannot reverse them. */
@media (min-width: 901px) {
  .admin-aaa-body .aaa-sidebar,
  .admin-aaa-body aside.aaa-sidebar {
    position: relative !important;
    inset: auto !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
    align-self: stretch !important;
  }
}

.admin-aaa-body .aaa-content-area,
.admin-aaa-body .content-area.aaa-content-area,
.admin-aaa-body .feedback-aaa-content {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
}

.admin-aaa-body select,
.admin-aaa-body select option,
.admin-aaa-body .aaa-themed-select,
.admin-aaa-body .aaa-themed-select option {
  color: #202638 !important;
  background: #ffffff !important;
}

.admin-aaa-body .status-message.error,
.admin-aaa-body .roles-status.error,
.admin-aaa-body .role-panel-status.error,
.admin-aaa-body .security-status.error {
  color: #8a1728 !important;
  background: #ffeaee !important;
  border-color: #e9aab5 !important;
}

.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card {
  color: #ffffff !important;
  background: linear-gradient(145deg, #17224a, #0b1232) !important;
  border-color: #344477 !important;
}

.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card-copy strong,
.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card-copy > span,
.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card-chevron {
  color: #ffffff !important;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card {
  color: #242a3c !important;
  background: linear-gradient(145deg, #ffffff, #f8f6ff) !important;
  border: 2px solid #7657ed !important;
  box-shadow: 0 18px 42px rgba(95, 66, 212, 0.20) !important;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-copy strong,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-copy > span,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-chevron {
  color: #34246f !important;
}

.admin-aaa-body .aaa-category-open-indicator {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  gap: 7px;
  margin-top: 12px !important;
  padding: 7px 10px;
  border-radius: 999px;
  color: #ffffff !important;
  background: #6b4de6 !important;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-count {
  color: #ffffff !important;
  background: #6b4de6 !important;
  border-color: #6b4de6 !important;
}

.admin-aaa-body .import-draft-content,
.admin-aaa-body .aaa-category-card-preview {
  max-height: none !important;
  overflow: visible !important;
  mask-image: none !important;
}

.admin-aaa-body .import-draft-card .card-actions { flex-wrap: wrap; }
.admin-aaa-body .auto-improve-draft-btn {
  color: #ffffff !important;
  background: linear-gradient(180deg, #7657ed, #6245dc) !important;
  border-color: transparent !important;
}

/* FIX: AI Improved Draft modal text visibility */
.admin-aaa-body #aiImprovedContent {
  color: #071126 !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(245,248,255,0.92)) !important;
  border: 1px solid rgba(124, 53, 255, 0.45) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.6),
    0 0 22px rgba(124, 53, 255, 0.18) !important;
}

/* Keep original side readable too */
.admin-aaa-body #aiOriginalContent {
  color: rgba(248, 251, 255, 0.9) !important;
}

/* Approve Selected: solid theme color */
.admin-aaa-body #approveSelectedDraftsBtn {
  background: #1c77ff !important;
  color: #ffffff !important;
  border: 1px solid rgba(120, 175, 255, 0.55) !important;
  box-shadow:
    0 12px 28px rgba(28, 119, 255, 0.24),
    0 0 22px rgba(28, 119, 255, 0.18) !important;
}

/* Improve Selected: special rainbow gradient */
.admin-aaa-body #improveSelectedDraftsBtn {
  background: linear-gradient(100deg, #166fff, #5c55ff 42%, #bd35ff 72%, #18c4ff) !important;
  color: #ffffff !important;
  border: 1px solid rgba(218, 229, 255, 0.42) !important;
  box-shadow:
    0 14px 34px rgba(23, 105, 255, 0.28),
    0 0 30px rgba(190, 55, 255, 0.26) !important;
}

.admin-aaa-body #improveSelectedDraftsBtn:hover,
.admin-aaa-body #approveSelectedDraftsBtn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* =========================================================
   IMPORT DRAFT CARD BUTTON FIXES
   ========================================================= */

/* EDIT DRAFT BUTTON */
.admin-aaa-body .edit-draft-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid rgba(147, 197, 253, 0.45) !important;
  box-shadow:
    0 10px 24px rgba(37, 99, 235, 0.24),
    0 0 18px rgba(37, 99, 235, 0.16) !important;
}

.admin-aaa-body .edit-draft-btn:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
}

/* APPROVE BUTTON */
.admin-aaa-body .approve-draft-btn {
  background: #10b981 !important;
  color: #ffffff !important;
  border: 1px solid rgba(110, 231, 183, 0.4) !important;
  box-shadow:
    0 10px 24px rgba(16, 185, 129, 0.22),
    0 0 18px rgba(16, 185, 129, 0.16) !important;
}

.admin-aaa-body .approve-draft-btn:hover {
  background: #059669 !important;
  color: #ffffff !important;
}

/* IGNORE BUTTON */
.admin-aaa-body .ignore-draft-btn,
.admin-aaa-body .delete-btn {
  background: rgba(255, 236, 240, 0.12) !important;
  color: #ff8fa3 !important;
  border: 1px solid rgba(255, 143, 163, 0.45) !important;
}

.admin-aaa-body .ignore-draft-btn:hover,
.admin-aaa-body .delete-btn:hover {
  background: rgba(255, 143, 163, 0.16) !important;
  color: #ffd5de !important;
}

/* =========================================================
   BULK TOOLBAR BUTTONS
   ========================================================= */

/* APPROVE SELECTED = SAME GREEN AS APPROVE CARD BUTTON */
.admin-aaa-body #approveSelectedDraftsBtn {
  background: #10b981 !important;
  color: #ffffff !important;
  border: 1px solid rgba(110, 231, 183, 0.4) !important;
  box-shadow:
    0 12px 30px rgba(16, 185, 129, 0.24),
    0 0 20px rgba(16, 185, 129, 0.18) !important;
}

.admin-aaa-body #approveSelectedDraftsBtn:hover {
  background: #059669 !important;
  color: #ffffff !important;
}

/* IMPROVE SELECTED = RAINBOW HERO BUTTON */
.admin-aaa-body #improveSelectedDraftsBtn {
  background:
    linear-gradient(
      100deg,
      #166fff,
      #5c55ff 40%,
      #bd35ff 72%,
      #18c4ff
    ) !important;

  color: #ffffff !important;

  border: 1px solid rgba(218, 229, 255, 0.42) !important;

  box-shadow:
    0 14px 34px rgba(23, 105, 255, 0.28),
    0 0 30px rgba(190, 55, 255, 0.26) !important;
}

.admin-aaa-body #improveSelectedDraftsBtn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* =========================================================
   GLOBAL AAA BUTTON HOVER SYSTEM
   ========================================================= */

/* Smooth animation for ALL buttons */
.admin-aaa-body button,
.admin-aaa-body .card-btn,
.admin-aaa-body .primary-btn,
.admin-aaa-body .secondary-btn,
.admin-aaa-body .danger-btn,
.admin-aaa-body .toolbar-btn,
.admin-aaa-body .action-btn {
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease;
}

/* Universal hover effect */
.admin-aaa-body button:hover,
.admin-aaa-body .card-btn:hover,
.admin-aaa-body .primary-btn:hover,
.admin-aaa-body .secondary-btn:hover,
.admin-aaa-body .danger-btn:hover,
.admin-aaa-body .toolbar-btn:hover,
.admin-aaa-body .action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* Slightly stronger glow for enabled buttons */
.admin-aaa-body button:not(:disabled):hover,
.admin-aaa-body .card-btn:not(:disabled):hover,
.admin-aaa-body .primary-btn:not(:disabled):hover,
.admin-aaa-body .secondary-btn:not(:disabled):hover,
.admin-aaa-body .danger-btn:not(:disabled):hover,
.admin-aaa-body .toolbar-btn:not(:disabled):hover,
.admin-aaa-body .action-btn:not(:disabled):hover {
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.22),
    0 0 22px rgba(91, 124, 255, 0.16);
}

/* Prevent disabled buttons from lifting */
.admin-aaa-body button:disabled,
.admin-aaa-body .card-btn:disabled {
  transform: none !important;
  filter: none !important;
  cursor: not-allowed;
}

/* =========================================================
   IMPORT DRAFTS HEADER + IGNORE BUTTON CONTRAST FIX
   ========================================================= */

/* Make Import Drafts headline white */
.admin-aaa-body .import-drafts-header h1,
.admin-aaa-body .drafts-title-group h1 {
  color: #ffffff !important;
}

/* Make Ignore buttons solid/darker red with strong contrast */
.admin-aaa-body .ignore-draft-btn,
.admin-aaa-body #ignoreSelectedDraftsBtn {
  background: #b91c1c !important;
  color: #ffffff !important;
  border: 1px solid rgba(248, 113, 113, 0.65) !important;
  box-shadow:
    0 10px 24px rgba(185, 28, 28, 0.28),
    0 0 18px rgba(248, 113, 113, 0.18) !important;
}

/* Hover: darker red, still white text */
.admin-aaa-body .ignore-draft-btn:hover,
.admin-aaa-body #ignoreSelectedDraftsBtn:hover {
  background: #7f1d1d !important;
  color: #ffffff !important;
  border-color: rgba(252, 165, 165, 0.8) !important;
  filter: brightness(1.05);
}

/* =========================================================
   IMPROVE DRAFT BUTTON
   ========================================================= */

.admin-aaa-body #improveDraftBtn,
.admin-aaa-body .improve-draft-btn {
  background:
    linear-gradient(
      100deg,
      #166fff,
      #5c55ff 40%,
      #bd35ff 72%,
      #18c4ff
    ) !important;

  color: #ffffff !important;

  border: 1px solid rgba(218, 229, 255, 0.42) !important;

  box-shadow:
    0 14px 34px rgba(23, 105, 255, 0.28),
    0 0 30px rgba(190, 55, 255, 0.26) !important;

  text-shadow: 0 1px 2px rgba(0,0,0,0.18);

  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    box-shadow 0.16s ease;
}

.admin-aaa-body #improveDraftBtn:hover,
.admin-aaa-body .improve-draft-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);

  box-shadow:
    0 18px 40px rgba(23, 105, 255, 0.34),
    0 0 38px rgba(190, 55, 255, 0.34) !important;
}
/* =========================================================
   SIDEBAR NAV FIT + ACTIVE HIGHLIGHT FIX
   ========================================================= */

.admin-aaa-body .aaa-sidebar {
  width: 148px !important;
  min-width: 148px !important;
  padding: 18px 10px !important;
}

.admin-aaa-body .aaa-sidebar-nav {
  width: 100%;
  gap: 8px;
}

.admin-aaa-body .aaa-nav-link,
.admin-aaa-body .sidebar-bottom-link.aaa-nav-link {
  width: 100% !important;
  min-height: 74px;
  padding: 8px 6px;
  border-radius: 18px;
  overflow: visible;
  text-align: center;
  line-height: 1.1;
}

.admin-aaa-body .aaa-nav-link span {
  display: block;
  width: 100%;
  max-width: 112px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  text-align: center;
  font-size: 12px;
  line-height: 1.12;
}

/* Active background fills most of sidebar width */
.admin-aaa-body .aaa-nav-link.active {
  width: 100% !important;
  background:
    radial-gradient(circle at top left, rgba(24, 196, 255, 0.38), transparent 36%),
    linear-gradient(135deg, rgba(28, 119, 255, 0.9), rgba(124, 53, 255, 0.84)) !important;
  box-shadow:
    0 0 0 1px rgba(179, 200, 255, 0.18) inset,
    0 12px 34px rgba(58, 74, 255, 0.30),
    0 0 34px rgba(156, 52, 255, 0.28) !important;
}

/* Remove skinny left strip since the whole button now highlights */
.admin-aaa-body .aaa-nav-link.active::before {
  display: none !important;
}

/* Slightly smaller icon so text has room */
.admin-aaa-body .aaa-nav-link svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Mobile/tablet sidebar still scrolls cleanly */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar {
    width: 100% !important;
    min-width: 0 !important;
  }

  .admin-aaa-body .aaa-nav-link,
  .admin-aaa-body .sidebar-bottom-link.aaa-nav-link {
    min-width: 92px;
    width: 92px !important;
  }

  .admin-aaa-body .aaa-nav-link span {
    max-width: 82px;
  }
}

/* =========================================================
   TOP BAR COMPANY NAME
   ========================================================= */

.admin-aaa-body .aaa-topbar-title {
  color: #ffffff;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Remove old crown spacing if still present */
.admin-aaa-body .aaa-crown {
  display: none !important;
}

/* =========================================================
   SUPPORT PAGE TWO-BUTTON MODE SWITCH
   ========================================================= */

.admin-aaa-body .support-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
  max-width: 900px;
}

.admin-aaa-body .support-mode-card {
  min-height: 142px;
  border: 1px solid rgba(223, 232, 255, 0.46);
  border-radius: 20px;
  padding: 22px 18px;
  color: #ffffff;
  cursor: pointer;
  text-align: center;
  background:
    radial-gradient(circle at top right, rgba(47, 151, 255, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(245, 248, 255, 0.20), rgba(229, 237, 255, 0.10));
  box-shadow:
    0 18px 52px rgba(0,0,0,0.20),
    0 0 0 1px rgba(255,255,255,0.035) inset;
  backdrop-filter: blur(22px) saturate(156%);
  -webkit-backdrop-filter: blur(22px) saturate(156%);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.admin-aaa-body .support-mode-card span {
  color: rgba(238, 244, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-aaa-body .support-mode-card strong {
  color: #ffffff;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 22px rgba(56, 132, 255, 0.20);
}

.admin-aaa-body .support-mode-card.active {
  border-color: rgba(124, 53, 255, 0.72);
  background:
    radial-gradient(circle at top left, rgba(24, 196, 255, 0.28), transparent 38%),
    linear-gradient(135deg, rgba(28, 119, 255, 0.86), rgba(124, 53, 255, 0.78));
  box-shadow:
    0 18px 48px rgba(38, 91, 255, 0.28),
    0 0 34px rgba(156, 52, 255, 0.24);
}

.admin-aaa-body .support-panel-stage {
  display: block !important;
  max-width: 960px;
}

.admin-aaa-body .support-tab-panel[hidden] {
  display: none !important;
}

.admin-aaa-body .support-tab-panel.active {
  display: block;
}

@media (max-width: 760px) {
  .admin-aaa-body .support-mode-switch {
    grid-template-columns: 1fr;
  }
}


.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.featured-btn {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    color 0.18s ease,
    text-shadow 0.18s ease;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.featured-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.featured-btn svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.featured-btn:hover {
  transform: translateY(-2px) scale(1.08);
  color: #ffd95e;
  text-shadow: 0 0 14px rgba(255,217,94,0.55);
}

.featured-btn.featured-active {
  color: #ffd95e;
  text-shadow: 0 0 14px rgba(255,217,94,0.55);
}

.featured-btn.featured-active svg path {
  fill: currentColor;
  stroke: currentColor;
}

.featured-btn:hover {
  transform: translateY(-2px) scale(1.08);
  color: #ffd95e;
  text-shadow: 0 0 14px rgba(255,217,94,0.55);
}

.featured-btn.featured-active {
  color: #ffd95e;
  text-shadow: 0 0 14px rgba(255,217,94,0.55);
}

/* Topic Associations text visibility fix */
.admin-aaa-body .association-row,
.admin-aaa-body .association-row span,
.admin-aaa-body .association-list,
.admin-aaa-body .association-list * {
  color: rgba(255, 255, 255, 0.82) !important;
}

/* Topic Associations improved contrast */
.admin-aaa-body .association-row {
  color: rgba(255,255,255,0.68) !important;
}

.admin-aaa-body .association-row strong,
.admin-aaa-body .association-row .association-search-term {
  color: rgba(255,255,255,0.92) !important;
}

.featured-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

/* =========================================================
   KNOWLEDGE EDITOR MODAL AAA THEME FIX
   ========================================================= */
.admin-aaa-body .knowledge-editor-panel > .panel-header,
.admin-aaa-body .knowledge-editor-panel > .panel-body {
  background:
    radial-gradient(circle at 92% 0%, rgba(124, 58, 237, 0.22), transparent 34%),
    radial-gradient(circle at 0% 50%, rgba(59, 130, 246, 0.10), transparent 40%),
    linear-gradient(
      135deg,
      rgba(18, 26, 68, 0.96),
      rgba(28, 38, 92, 0.94),
      rgba(52, 32, 110, 0.92)
    ) !important;

  color: #ffffff !important;

  border: 1px solid rgba(255,255,255,0.12) !important;

  box-shadow:
    0 10px 40px rgba(0,0,0,0.24),
    inset 0 1px 0 rgba(255,255,255,0.06);

  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

/* Edit Knowledge Entry title */
.admin-aaa-body .knowledge-editor-panel .panel-header h2,
.admin-aaa-body .knowledge-editor-panel .panel-title {
  color: #ffffff !important;
}


/* =========================================================
   KNOWLEDGE EDITOR TITLE + SAVE BUTTON
   ========================================================= */

/* Make Edit Knowledge Entry title white */
.admin-aaa-body .knowledge-editor-panel .panel-header h2,
.admin-aaa-body .knowledge-editor-panel .panel-title {
  color: #ffffff !important;
}

/* Save Entry button = same green as import approve */
.admin-aaa-body #saveBtn,
.admin-aaa-body .save-entry-btn {
  background: #10b981 !important;
  color: #ffffff !important;

  border: 1px solid rgba(110, 231, 183, 0.42) !important;

  box-shadow:
    0 12px 30px rgba(16, 185, 129, 0.24),
    0 0 20px rgba(16, 185, 129, 0.14) !important;
}

.admin-aaa-body #saveBtn:hover,
.admin-aaa-body .save-entry-btn:hover {
  background: #059669 !important;
  transform: translateY(-2px);
}

/* =========================================================
   ACTIVE TOGGLE LABEL POSITION + COLOR
   ========================================================= */

/* =========================================================
   ACTIVE TOGGLE LAYOUT
   ========================================================= */

.admin-aaa-body .toggle-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;

  color: #ffffff !important;
  font-weight: 700;
}

.admin-aaa-body .toggle-row label,
.admin-aaa-body .toggle-row span,
.admin-aaa-body .toggle-row .field-label {
  color: #ffffff !important;
}

/* Remove forced right alignment */
.admin-aaa-body .toggle-row .toggle-switch,
.admin-aaa-body .toggle-row .switch {
  margin-left: 0 !important;
  align-self: flex-start;
}

/* =========================================================
   CATEGORY DROPDOWN ARROW VISIBILITY
   ========================================================= */

.admin-aaa-body .knowledge-editor-panel select,
.admin-aaa-body .category-smart-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding-right: 54px !important;

  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.92)' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 18px;
}

/* =========================================================
   TITLE INPUT MATCH CONTENT FIELD STYLE
   ========================================================= */

.admin-aaa-body .knowledge-editor-panel input[name="title"],
.admin-aaa-body .knowledge-editor-panel #titleInput,
.admin-aaa-body .knowledge-editor-panel .title-input {
  background: rgba(11, 17, 51, 0.72) !important;
  color: #ffffff !important;

  border: 1px solid rgba(167, 184, 255, 0.36) !important;

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 12px 30px rgba(0,0,0,0.16) !important;
}

/* Title field should match content textarea */
.admin-aaa-body .knowledge-editor-panel #title {
  background: rgba(11, 17, 51, 0.72) !important;
  color: #ffffff !important;
  border: 1px solid rgba(167, 184, 255, 0.36) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 12px 30px rgba(0,0,0,0.16) !important;
}

/* =========================================================
   CATEGORY DROPDOWN MENU AAA THEME
   ========================================================= */

.admin-aaa-body .knowledge-editor-panel select option {
  background: #111936 !important;
  color: rgba(255,255,255,0.92) !important;
}

.admin-aaa-body .knowledge-editor-panel select option:checked,
.admin-aaa-body .knowledge-editor-panel select option:hover {
  background: linear-gradient(
    135deg,
    rgba(59,130,246,0.85),
    rgba(147,51,234,0.82)
  ) !important;

  color: #ffffff !important;
}

/* Force native dropdown to prefer dark UI */
.admin-aaa-body .knowledge-editor-panel #categorySelect,
.admin-aaa-body .knowledge-editor-panel .category-smart-select {
  color-scheme: dark;

  background: rgba(11, 17, 51, 0.72) !important;
  color: #ffffff !important;

  border: 1px solid rgba(167, 184, 255, 0.36) !important;

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 12px 30px rgba(0,0,0,0.16) !important;
}

.admin-aaa-body .knowledge-editor-panel #categorySelect option {
  background-color: #111936;
  color: #ffffff;
}

/* =========================================================
   KNOWLEDGE VIEW TOGGLE + CATEGORY LIST VIEW
   ========================================================= */

.admin-aaa-body .aaa-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -4px 0 22px;
}

.admin-aaa-body .aaa-view-summary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
}

.admin-aaa-body .aaa-view-count {
  min-width: 48px;
  height: 34px;
  padding: 0 13px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: #bda7ff;
  background: linear-gradient(135deg, rgba(124, 53, 255, 0.42), rgba(28, 119, 255, 0.18));
  border: 1px solid rgba(164, 130, 255, 0.24);
  box-shadow: 0 0 24px rgba(124, 53, 255, 0.22);
  font-size: 16px;
}

.admin-aaa-body .aaa-view-actions {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 15px;
  background: rgba(7, 11, 35, 0.56);
  border: 1px solid rgba(171, 190, 255, 0.22);
  box-shadow: 0 14px 38px rgba(0,0,0,0.16);
}

.admin-aaa-body .aaa-view-btn {
  width: 58px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: rgba(248, 251, 255, 0.70);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.admin-aaa-body .aaa-view-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-aaa-body .aaa-view-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(28, 119, 255, 0.78), rgba(124, 53, 255, 0.74));
  box-shadow: 0 12px 28px rgba(61, 77, 255, 0.28), 0 0 24px rgba(124, 53, 255, 0.22);
}

.admin-aaa-body .aaa-knowledge-list-view,
.admin-aaa-body .knowledge-grid.aaa-knowledge-list-view {
  display: flex !important;
  flex-direction: column;
  gap: 14px;
}

.admin-aaa-body .aaa-category-list-group {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  border: 1px solid rgba(132, 157, 255, 0.28);
  border-radius: 18px;
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(circle at 9% 18%, rgba(31, 119, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(18, 24, 62, 0.78), rgba(8, 12, 42, 0.82));
  box-shadow: 0 16px 42px rgba(0,0,0,0.19), 0 0 0 1px rgba(255,255,255,0.025) inset;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.admin-aaa-body .aaa-category-list-header {
  min-height: 80px;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-right: 1px solid rgba(132, 157, 255, 0.22);
  border-radius: 0;
  color: #ffffff;
  background: rgba(238, 244, 255, 0.045);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 22px;
  gap: 14px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.admin-aaa-body .aaa-category-list-group {
  cursor: pointer;
}

.admin-aaa-body .aaa-category-list-group .aaa-list-more-btn,
.admin-aaa-body .aaa-category-list-group .edit-btn,
.admin-aaa-body .aaa-category-list-group .delete-btn {
  cursor: pointer;
}

.admin-aaa-body .aaa-category-list-left {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.admin-aaa-body .aaa-category-list-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(28, 119, 255, 0.95), rgba(124, 53, 255, 0.88));
  box-shadow: 0 0 24px rgba(82, 96, 255, 0.30);
  font-weight: 700;
  font-size: 22px;
}

.admin-aaa-body .aaa-category-list-icon.cat-services { background: linear-gradient(135deg, #16a8c7, #1f6bff); }
.admin-aaa-body .aaa-category-list-icon.cat-parking { background: linear-gradient(135deg, #ff7a18, #f43f5e); }
.admin-aaa-body .aaa-category-list-icon.cat-policies { background: linear-gradient(135deg, #7c35ff, #c73cff); }

.admin-aaa-body .aaa-category-list-title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-aaa-body .aaa-category-list-title-wrap strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
}

.admin-aaa-body .aaa-category-list-title-wrap span,
.admin-aaa-body .aaa-list-entry-updated {
  color: rgba(219, 227, 255, 0.68);
  font-weight: 600;
}

.admin-aaa-body .aaa-category-list-count {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  background: rgba(238, 244, 255, 0.10);
  border: 1px solid rgba(238, 244, 255, 0.10);
  color: #ffffff;
  font-weight: 700;
}

.admin-aaa-body .aaa-category-list-chevron {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.admin-aaa-body .aaa-category-list-group.expanded .aaa-category-list-chevron {
  transform: rotate(180deg);
}

.admin-aaa-body .aaa-category-list-entries {
  min-width: 0;
}

.admin-aaa-body .aaa-list-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 170px 52px;
  gap: 18px;
  align-items: center;
  min-height: 58px;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(238, 244, 255, 0.075);
}

.admin-aaa-body .aaa-list-entry-row:last-child {
  border-bottom: 0;
}

.admin-aaa-body .aaa-category-list-group:not(.expanded) .aaa-list-entry-row:nth-child(n+2) {
  display: none;
}

.admin-aaa-body .aaa-list-entry-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: rgba(248, 251, 255, 0.86);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.admin-aaa-body .aaa-list-entry-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-aaa-body .aaa-list-entry-preview {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.admin-aaa-body .aaa-list-entry-row:hover {
  background: rgba(238, 244, 255, 0.065);
}

.admin-aaa-body .aaa-list-doc-icon {
  color: rgba(248, 251, 255, 0.80);
  font-size: 18px;
  flex: 0 0 auto;
}

.admin-aaa-body .aaa-list-entry-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(248, 251, 255, 0.90);
  font-weight: 700;
}

.admin-aaa-body .aaa-list-entry-status span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--aaa-green);
  box-shadow: 0 0 12px rgba(41, 217, 139, 0.70);
}

.admin-aaa-body .aaa-list-entry-status.inactive span {
  background: rgba(248, 251, 255, 0.38);
  box-shadow: none;
}

.admin-aaa-body .aaa-list-more-btn {
  width: 38px;
  height: 34px;
  border: 0;
  border-radius: 11px;
  color: #ffffff;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  letter-spacing: 2px;
  font-weight: 700;
}

.admin-aaa-body .aaa-list-more-btn:hover {
  background: rgba(238, 244, 255, 0.10);
}

@media (max-width: 980px) {
  .admin-aaa-body .aaa-category-list-group {
    grid-template-columns: 1fr;
  }

  .admin-aaa-body .aaa-category-list-header {
    border-right: 0;
    border-bottom: 1px solid rgba(132, 157, 255, 0.22);
  }

  .admin-aaa-body .aaa-list-entry-row {
    grid-template-columns: minmax(0, 1fr) 120px 44px;
  }

  .admin-aaa-body .aaa-list-entry-updated {
    display: none;
  }
}

@media (max-width: 640px) {
  .admin-aaa-body .aaa-view-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-aaa-body .aaa-view-actions {
    width: 100%;
  }

  .admin-aaa-body .aaa-view-btn {
    flex: 1;
  }

  .admin-aaa-body .aaa-list-entry-row {
    grid-template-columns: 1fr 40px;
    gap: 10px;
  }

  .admin-aaa-body .aaa-list-entry-status {
    display: none;
  }
}

/* =========================================================
   CARD VIEW CATEGORY GROUPING
   ========================================================= */

.admin-aaa-body .aaa-knowledge-card-groups,
.admin-aaa-body .knowledge-grid.aaa-knowledge-card-groups {
  display: flex !important;
  flex-direction: column;
  gap: 18px;
}

.admin-aaa-body .aaa-category-card-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-aaa-body .aaa-category-card {
  width: 100%;
  min-height: 118px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid rgba(223, 232, 255, 0.52);
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 18px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.26), transparent 30%),
    radial-gradient(circle at 92% 18%, rgba(158, 74, 255, 0.18), transparent 36%),
    linear-gradient(145deg, rgba(245, 248, 255, 0.22), rgba(229, 237, 255, 0.11));
  box-shadow:
    0 18px 52px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,255,255,0.035) inset;
  backdrop-filter: blur(22px) saturate(156%);
  -webkit-backdrop-filter: blur(22px) saturate(156%);
}

.admin-aaa-body .aaa-category-card-group.expanded .aaa-category-card {
  border-color: rgba(132, 157, 255, 0.34);
  background:
    radial-gradient(circle at 9% 18%, rgba(31, 119, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(18, 24, 62, 0.82), rgba(8, 12, 42, 0.88));
  box-shadow:
    0 16px 42px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,255,255,0.025) inset;
}

.admin-aaa-body .aaa-category-card-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(28, 119, 255, 0.95), rgba(124, 53, 255, 0.88));
  box-shadow: 0 0 24px rgba(82, 96, 255, 0.30);
  font-size: 25px;
  font-weight: 700;
}

.admin-aaa-body .aaa-category-card-icon.cat-services { background: linear-gradient(135deg, #16a8c7, #1f6bff); }
.admin-aaa-body .aaa-category-card-icon.cat-parking { background: linear-gradient(135deg, #ff7a18, #f43f5e); }
.admin-aaa-body .aaa-category-card-icon.cat-policies { background: linear-gradient(135deg, #7c35ff, #c73cff); }

.admin-aaa-body .aaa-category-card-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.admin-aaa-body .aaa-category-card-copy strong {
  color: #ffffff;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-aaa-body .aaa-category-card-copy span {
  color: rgba(219, 227, 255, 0.74);
  font-size: 14px;
  font-weight: 600;
}

.admin-aaa-body .aaa-category-card-count {
  min-width: 42px;
  height: 36px;
  padding: 0 13px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  background: rgba(238, 244, 255, 0.10);
  border: 1px solid rgba(238, 244, 255, 0.12);
  font-weight: 700;
}

.admin-aaa-body .aaa-category-card-chevron {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.admin-aaa-body .aaa-category-card-group.expanded .aaa-category-card-chevron {
  transform: rotate(180deg);
}

.admin-aaa-body .aaa-category-card-entries {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  animation: aaaCategoryCardsIn 0.18s ease both;
}

.admin-aaa-body .aaa-category-card-group.expanded .aaa-category-card-entries {
  display: grid;
}

@keyframes aaaCategoryCardsIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1220px) {
  .admin-aaa-body .aaa-category-card-entries {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-aaa-body .aaa-category-card {
    grid-template-columns: 52px minmax(0, 1fr) 24px;
    padding: 18px;
  }

  .admin-aaa-body .aaa-category-card-count {
    display: none;
  }

  .admin-aaa-body .aaa-category-card-entries {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   CARD VIEW STACKED CATEGORY GRID CORRECTION
   Keeps card view as a true 3-column card layout.
   ========================================================= */

.admin-aaa-body .aaa-knowledge-card-groups,
.admin-aaa-body .knowledge-grid.aaa-knowledge-card-groups {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch;
}

.admin-aaa-body .aaa-category-card-grid-item {
  min-height: 230px;
  display: flex;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card {
  min-height: 230px;
  height: 100%;
  width: 100%;
  padding: 20px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  align-items: start;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-icon {
  grid-column: 1;
  grid-row: 1;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-copy {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: center;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-copy strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: 21px;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-copy span {
  margin-top: 6px;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-count {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-chevron {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card {
  border-color: rgba(132, 157, 255, 0.34);
  background:
    radial-gradient(circle at 9% 18%, rgba(31, 119, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(18, 24, 62, 0.82), rgba(8, 12, 42, 0.88));
  box-shadow:
    0 16px 42px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,255,255,0.025) inset;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-chevron {
  transform: rotate(180deg);
}

.admin-aaa-body .aaa-knowledge-card-groups .knowledge-card {
  animation: aaaCategoryCardsIn 0.18s ease both;
}

.admin-aaa-body .aaa-card-grid-filler {
  display: block;
  min-height: 1px;
  pointer-events: none;
  visibility: hidden;
}

@media (max-width: 1220px) {
  .admin-aaa-body .aaa-knowledge-card-groups,
  .admin-aaa-body .knowledge-grid.aaa-knowledge-card-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .admin-aaa-body .aaa-card-grid-filler {
    display: none;
  }
}

@media (max-width: 900px) {
  .admin-aaa-body .aaa-knowledge-card-groups,
  .admin-aaa-body .knowledge-grid.aaa-knowledge-card-groups {
    grid-template-columns: 1fr !important;
  }

  .admin-aaa-body .aaa-category-card-grid-item .aaa-category-card {
    min-height: 190px;
    grid-template-columns: 52px minmax(0, 1fr) 24px;
  }

  .admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-count {
    display: none;
  }
}

/* =========================================================
   CARD VIEW CATEGORY PREVIEWS + EXPANDED STATE
   ========================================================= */

.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item .aaa-category-card {
  border-color: rgba(132, 157, 255, 0.34);
  background:
    radial-gradient(circle at 9% 18%, rgba(31, 119, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(18, 24, 62, 0.82), rgba(8, 12, 42, 0.88)) !important;
  box-shadow:
    0 16px 42px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,255,255,0.025) inset;
}

.admin-aaa-body .aaa-category-card-preview {
  margin-top: 14px;
  max-height: 78px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(198, 212, 255, 0.34) transparent;
  mask-image: linear-gradient(to bottom, black 0%, black 72%, transparent 100%);
}

.admin-aaa-body .aaa-category-card-preview::-webkit-scrollbar {
  width: 4px;
}

.admin-aaa-body .aaa-category-card-preview::-webkit-scrollbar-thumb {
  background: rgba(198, 212, 255, 0.34);
  border-radius: 999px;
}

.admin-aaa-body .aaa-category-preview-line {
  min-height: 30px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 4px 7px;
  border-radius: 10px;
  background: rgba(238, 244, 255, 0.075);
  border: 1px solid rgba(238, 244, 255, 0.08);
}

.admin-aaa-body .aaa-category-preview-line span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 999px;
  color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.10);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
}

.admin-aaa-body .aaa-category-preview-line p {
  margin: 0;
  min-width: 0;
  color: rgba(248, 251, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-preview {
  opacity: 0.58;
}


/* =========================================================
   FINAL OVERRIDE: CATEGORY CARDS ARE ALWAYS DARK
   Applies to collapsed, expanded, and all-category-open states.
   ========================================================= */

.admin-aaa-body .aaa-category-card,
.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card,
.admin-aaa-body .aaa-category-card-group .aaa-category-card,
.admin-aaa-body .aaa-category-card-group.expanded .aaa-category-card,
.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item .aaa-category-card {
  background:
    radial-gradient(circle at 9% 18%, rgba(31, 119, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(18, 24, 62, 0.92), rgba(8, 12, 42, 0.96)) !important;

  border-color: rgba(132, 157, 255, 0.34) !important;

  box-shadow:
    0 16px 42px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,255,255,0.025) inset !important;
}

/* Keep the category card from flashing bright during hover/focus/active states */
.admin-aaa-body .aaa-category-card:hover,
.admin-aaa-body .aaa-category-card:focus,
.admin-aaa-body .aaa-category-card:active,
.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card:hover,
.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card:focus,
.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card:active {
  background:
    radial-gradient(circle at 9% 18%, rgba(31, 119, 255, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(20, 29, 70, 0.96), rgba(9, 14, 48, 0.98)) !important;

  border-color: rgba(158, 181, 255, 0.44) !important;
}

/* Category preview rows stay readable against the dark card */
.admin-aaa-body .aaa-category-card-preview {
  background: rgba(238, 244, 255, 0.06) !important;
  border: 1px solid rgba(238, 244, 255, 0.10) !important;
}

.admin-aaa-body .aaa-category-preview-line {
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Sticky header update */
.aaa-topbar,
.topbar.aaa-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* =========================================================
   MOBILE HEADER LAYER FIX + NON-BLOCKING TOOLBAR SCROLL CUE
   Toolbar layout is left as the original uploaded version.
   ========================================================= */

/* Keep the Add/Edit Knowledge panel above sticky/mobile bars. */
.admin-aaa-body .knowledge-editor-panel,
.admin-aaa-body .knowledge-editor-panel.open,
.admin-aaa-body .aaa-editor-panel,
.admin-aaa-body .aaa-editor-panel.open {
  z-index: 5000 !important;
}

.admin-aaa-body #knowledgeAiOverlay,
.admin-aaa-body .aaa-duplicate-overlay {
  z-index: 6000 !important;
}

/* Keep the title/header sticky, but behind modal panels. */
.admin-aaa-body .aaa-topbar,
.admin-aaa-body .topbar.aaa-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
}

@media (max-width: 900px) {
  /* Do not change the original toolbar mechanics; only guarantee touch/click behavior. */
  .admin-aaa-body .aaa-sidebar {
    pointer-events: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .admin-aaa-body .aaa-sidebar::-webkit-scrollbar {
    display: none;
  }

  .admin-aaa-body .aaa-sidebar a,
  .admin-aaa-body .aaa-sidebar button,
  .admin-aaa-body .aaa-nav-link,
  .admin-aaa-body .sidebar-bottom-link.aaa-nav-link {
    pointer-events: auto !important;
  }

  /* Visual-only scroll indicator. It is not inside the toolbar, so it cannot block taps/scrolling. */
  .admin-aaa-body::before {
    content: "›";
    position: fixed;
    top: 96px;
    right: 8px;
    width: 34px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(90deg, rgba(6, 10, 32, 0), rgba(18, 32, 92, 0.90) 42%, rgba(42, 92, 210, 0.94));
    box-shadow: 0 0 18px rgba(65, 126, 255, 0.30);
    font-size: 30px;
    line-height: 1;
    font-weight: 700;
    pointer-events: none !important;
    z-index: 1100;
  }

  /* Hide the scroll cue while the editor or duplicate modal is open. */
  .admin-aaa-body:has(.knowledge-editor-panel.open)::before,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden]))::before {
    display: none;
  }
}

/* =========================================================
   MOBILE TOP BAR + TOOLBAR ORDER FIX
   Keeps the top bar fixed at the top and places the horizontal
   admin toolbar directly underneath it without changing toolbar behavior.
   ========================================================= */
@media (max-width: 900px) {
  body.admin-aaa-body {
    --aaa-mobile-topbar-height: 78px;
  }

  .admin-aaa-body {
    padding-top: var(--aaa-mobile-topbar-height);
  }

  /* Restore the original background overlay on mobile. The scroll cue no longer uses body::before. */
  body.admin-aaa-body::before,
  .admin-aaa-body::before {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    border-radius: 0 !important;
    color: inherit !important;
    background:
      linear-gradient(180deg, rgba(2, 5, 20, 0.2), rgba(2, 5, 20, 0.72)),
      url("/instint-swoop-bg.svg") center / cover no-repeat !important;
    box-shadow: none !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: normal !important;
    opacity: 0.98 !important;
    pointer-events: none !important;
    z-index: 0 !important;
  }

  .admin-aaa-body .aaa-topbar,
  .admin-aaa-body .topbar.aaa-topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 3000 !important;
    height: var(--aaa-mobile-topbar-height) !important;
    min-height: var(--aaa-mobile-topbar-height) !important;
    padding: 0 14px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }

  .admin-aaa-body .aaa-topbar-brand,
  .admin-aaa-body .aaa-topbar-actions {
    min-width: 0 !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
  }

  .admin-aaa-body .aaa-topbar-actions {
    width: auto !important;
    justify-content: flex-end !important;
  }

  .admin-aaa-body .aaa-top-add,
  .admin-aaa-body .primary-btn.aaa-top-add {
    height: 46px !important;
    padding: 0 16px !important;
    white-space: nowrap !important;
  }

  .admin-aaa-body .aaa-icon-top,
  .admin-aaa-body .aaa-avatar {
    flex: 0 0 auto !important;
  }

  .admin-aaa-body .aaa-sidebar {
    position: sticky !important;
    top: var(--aaa-mobile-topbar-height) !important;
    z-index: 2200 !important;
    margin-top: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: 86px !important;
    flex-direction: row !important;
    align-items: center !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .admin-aaa-body .aaa-sidebar::-webkit-scrollbar {
    display: none !important;
  }

  /* Non-blocking visual cue that the horizontal toolbar can be swiped/scrolled. */
  .admin-aaa-body .aaa-sidebar::after {
    content: "›";
    position: fixed;
    top: calc(var(--aaa-mobile-topbar-height) + 18px);
    right: 7px;
    width: 32px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(90deg, rgba(6, 10, 32, 0), rgba(18, 32, 92, 0.90) 42%, rgba(42, 92, 210, 0.94));
    box-shadow: 0 0 18px rgba(65, 126, 255, 0.30);
    font-size: 30px;
    line-height: 1;
    font-weight: 700;
    pointer-events: none !important;
    z-index: 2300;
  }

  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-sidebar::after,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-sidebar::after {
    display: none;
  }

  .admin-aaa-body .knowledge-editor-panel,
  .admin-aaa-body .knowledge-editor-panel.open,
  .admin-aaa-body .aaa-editor-panel,
  .admin-aaa-body .aaa-editor-panel.open {
    z-index: 5000 !important;
  }
}

/* =========================================================
   FINAL MOBILE TOOLBAR RESTORE
   Keeps the mobile toolbar below the fixed top bar, but restores
   the original horizontal button sizing/scrolling behavior.
   ========================================================= */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar {
    position: sticky !important;
    top: var(--aaa-mobile-topbar-height, 78px) !important;
    z-index: 2200 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: 86px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
  }

  .admin-aaa-body .aaa-logo-link {
    flex: 0 0 74px !important;
    width: 74px !important;
    min-width: 74px !important;
  }

  .admin-aaa-body .aaa-sidebar-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: max-content !important;
    min-width: max-content !important;
    flex: 0 0 auto !important;
  }

  .admin-aaa-body .aaa-nav-link,
  .admin-aaa-body .sidebar-bottom-link.aaa-nav-link,
  .admin-aaa-body .aaa-nav-link.active {
    flex: 0 0 92px !important;
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    min-height: 66px !important;
    height: 66px !important;
    padding: 7px 6px !important;
  }

  .admin-aaa-body .aaa-admin-link {
    margin-top: 0 !important;
    border-top: 0 !important;
    padding-top: 7px !important;
  }

  .admin-aaa-body .aaa-nav-link span {
    max-width: 82px !important;
    white-space: normal !important;
  }

  .admin-aaa-body .aaa-sidebar::after {
    content: "›" !important;
    position: fixed !important;
    top: calc(var(--aaa-mobile-topbar-height, 78px) + 18px) !important;
    right: 7px !important;
    width: 32px !important;
    height: 48px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 999px !important;
    color: rgba(255, 255, 255, 0.95) !important;
    background: linear-gradient(90deg, rgba(6, 10, 32, 0), rgba(18, 32, 92, 0.90) 42%, rgba(42, 92, 210, 0.94)) !important;
    box-shadow: 0 0 18px rgba(65, 126, 255, 0.30) !important;
    font-size: 30px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    pointer-events: none !important;
    z-index: 2300 !important;
  }
}

/* =========================================================
   MOBILE TOOLBAR EDGE FADE + SCROLL STATE
   Visual only. Keeps the original horizontal toolbar behavior.
   ========================================================= */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar {
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overscroll-behavior-x: contain !important;
    cursor: grab;
  }

  .admin-aaa-body .aaa-sidebar:active {
    cursor: grabbing;
  }

  .admin-aaa-body .aaa-sidebar::before,
  .admin-aaa-body .aaa-sidebar::after {
    content: "" !important;
    position: fixed !important;
    top: var(--aaa-mobile-topbar-height, 78px) !important;
    height: 88px !important;
    width: 48px !important;
    pointer-events: none !important;
    z-index: 2300 !important;
    opacity: 0 !important;
    transition: opacity .18s ease !important;
    display: block !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .admin-aaa-body .aaa-sidebar::before {
    left: 0 !important;
    background: linear-gradient(90deg, rgba(4, 8, 30, .98), rgba(4, 8, 30, 0)) !important;
  }

  .admin-aaa-body .aaa-sidebar::after {
    right: 0 !important;
    width: 64px !important;
    background:
      linear-gradient(90deg, rgba(4, 8, 30, 0), rgba(4, 8, 30, .98) 72%),
      radial-gradient(circle at 76% 50%, rgba(59, 124, 255, .30), rgba(59, 124, 255, 0) 58%) !important;
  }

  .admin-aaa-body .aaa-sidebar.has-left-scroll::before {
    opacity: 1 !important;
  }

  .admin-aaa-body .aaa-sidebar.has-right-scroll::after {
    opacity: 1 !important;
  }

  .admin-aaa-body .aaa-sidebar.has-right-scroll .aaa-sidebar-nav::after {
    content: "›";
    position: sticky;
    right: 8px;
    align-self: center;
    flex: 0 0 28px;
    width: 28px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-left: -18px;
    border-radius: 999px;
    color: rgba(255, 255, 255, .96);
    background: rgba(43, 91, 205, .72);
    box-shadow: 0 0 18px rgba(65, 126, 255, .34);
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
    pointer-events: none;
    z-index: 2;
  }

  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-sidebar::before,
  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-sidebar::after,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-sidebar::before,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-sidebar::after,
  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-sidebar-nav::after,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-sidebar-nav::after {
    display: none !important;
  }
}

/* =========================================================
   MOBILE TOOLBAR FUNCTIONAL EDGE FADES
   Uses real non-clickable overlay elements controlled by JS.
   This avoids pseudo-element conflicts with the sidebar itself.
   ========================================================= */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar::before,
  .admin-aaa-body .aaa-sidebar::after,
  .admin-aaa-body .aaa-sidebar-nav::after {
    content: none !important;
    display: none !important;
  }

  .admin-aaa-body .aaa-mobile-toolbar-fade {
    position: fixed;
    top: var(--aaa-mobile-topbar-height, 78px);
    height: 88px;
    width: 56px;
    pointer-events: none;
    z-index: 2400;
    opacity: 0;
    transition: opacity .18s ease;
  }

  .admin-aaa-body .aaa-mobile-toolbar-fade.is-visible {
    opacity: 1;
  }

  .admin-aaa-body .aaa-mobile-toolbar-fade-left {
    left: 0;
    background: linear-gradient(90deg, rgba(4, 8, 30, .98), rgba(4, 8, 30, 0));
  }

  .admin-aaa-body .aaa-mobile-toolbar-fade-right {
    right: 0;
    width: 76px;
    background:
      linear-gradient(90deg, rgba(4, 8, 30, 0), rgba(4, 8, 30, .98) 72%),
      radial-gradient(circle at 78% 50%, rgba(59, 124, 255, .32), rgba(59, 124, 255, 0) 58%);
  }

  .admin-aaa-body .aaa-mobile-toolbar-fade-right::after {
    content: "›";
    position: absolute;
    right: 10px;
    top: 20px;
    width: 30px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: rgba(255, 255, 255, .96);
    background: rgba(43, 91, 205, .72);
    box-shadow: 0 0 18px rgba(65, 126, 255, .34);
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
  }

  .admin-aaa-body .aaa-mobile-toolbar-fade-left::after {
    content: "‹";
    position: absolute;
    left: 8px;
    top: 20px;
    width: 28px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: rgba(255, 255, 255, .82);
    background: rgba(16, 25, 72, .56);
    font-size: 26px;
    line-height: 1;
    font-weight: 700;
  }

  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-mobile-toolbar-fade,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-mobile-toolbar-fade {
    display: none !important;
  }
}

@media (min-width: 781px) {
  .aaa-mobile-toolbar-fade {
    display: none !important;
  }
}

/* Final mobile toolbar fade visibility fix: make the JS-controlled edge fades obvious and above the toolbar. */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-mobile-toolbar-fade {
    z-index: 2600 !important;
    display: block !important;
  }

  .admin-aaa-body .aaa-mobile-toolbar-fade.is-visible {
    opacity: 1 !important;
  }

  .admin-aaa-body .aaa-mobile-toolbar-fade-right {
    width: 92px !important;
    background:
      linear-gradient(90deg, rgba(4, 8, 30, 0), rgba(4, 8, 30, .86) 54%, rgba(4, 8, 30, .98) 100%),
      radial-gradient(circle at 76% 50%, rgba(59, 124, 255, .45), rgba(59, 124, 255, 0) 58%) !important;
  }

  .admin-aaa-body .aaa-mobile-toolbar-fade-left {
    width: 64px !important;
    background: linear-gradient(90deg, rgba(4, 8, 30, .98), rgba(4, 8, 30, .70) 42%, rgba(4, 8, 30, 0)) !important;
  }
}

/* =========================================================
   MOBILE TOOLBAR EDGE FADE - HARD FIX
   Uses the toolbar's own pseudo-elements so the fade is visible even if
   the JS-created overlay elements are not present yet.
   ========================================================= */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar {
    position: sticky !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    isolation: isolate !important;
  }

  .admin-aaa-body .aaa-sidebar::before,
  .admin-aaa-body .aaa-sidebar::after {
    content: "" !important;
    display: block !important;
    position: fixed !important;
    top: var(--aaa-mobile-topbar-height, 78px) !important;
    height: 88px !important;
    pointer-events: none !important;
    z-index: 3900 !important;
    opacity: 0 !important;
    transition: opacity .18s ease !important;
  }

  .admin-aaa-body .aaa-sidebar::before {
    left: 0 !important;
    width: 54px !important;
    background: linear-gradient(90deg, rgba(4, 8, 30, 1), rgba(4, 8, 30, .76) 42%, rgba(4, 8, 30, 0)) !important;
  }

  .admin-aaa-body .aaa-sidebar::after {
    right: 0 !important;
    width: 104px !important;
    opacity: 1 !important;
    background:
      linear-gradient(90deg, rgba(4, 8, 30, 0), rgba(4, 8, 30, .68) 38%, rgba(4, 8, 30, 1) 100%),
      radial-gradient(circle at 72% 50%, rgba(74, 135, 255, .46), rgba(74, 135, 255, 0) 62%) !important;
  }

  .admin-aaa-body .aaa-sidebar.has-left-scroll::before {
    opacity: 1 !important;
  }

  .admin-aaa-body .aaa-sidebar:not(.has-right-scroll)::after {
    opacity: 0 !important;
  }

  .admin-aaa-body .aaa-sidebar.has-right-scroll::after {
    opacity: 1 !important;
  }

  .admin-aaa-body .aaa-sidebar.has-right-scroll + .aaa-toolbar-scroll-peek,
  .admin-aaa-body .aaa-toolbar-scroll-peek.is-visible {
    display: grid !important;
    opacity: 1 !important;
  }

  .admin-aaa-body .aaa-toolbar-scroll-peek {
    position: fixed !important;
    top: calc(var(--aaa-mobile-topbar-height, 78px) + 21px) !important;
    right: 12px !important;
    width: 30px !important;
    height: 44px !important;
    place-items: center !important;
    border-radius: 999px !important;
    background: rgba(53, 105, 235, .76) !important;
    color: #fff !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    box-shadow: 0 0 20px rgba(75, 136, 255, .38) !important;
    pointer-events: none !important;
    z-index: 4000 !important;
    opacity: 0 !important;
    display: none !important;
  }

  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-sidebar::before,
  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-sidebar::after,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-sidebar::before,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-sidebar::after,
  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-toolbar-scroll-peek,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-toolbar-scroll-peek {
    display: none !important;
  }
}


/* =========================================================
   FINAL MOBILE TOOLBAR EDGE FADE — REAL OVERLAY FIX
   These are real sibling elements, not pseudo-elements, so they
   remain visible above the scrolling toolbar and do not affect taps.
   ========================================================= */
@media (max-width: 900px) {
  .admin-aaa-body {
    --aaa-mobile-topbar-height: 78px;
  }

  .admin-aaa-body .aaa-sidebar {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
  }

  .admin-aaa-body .aaa-sidebar-nav {
    width: max-content !important;
    min-width: max-content !important;
    flex: 0 0 auto !important;
    padding-right: 86px !important;
  }

  .admin-aaa-body .aaa-toolbar-edge-fade {
    position: fixed !important;
    top: var(--aaa-mobile-topbar-height, 78px) !important;
    height: 90px !important;
    pointer-events: none !important;
    z-index: 2999 !important;
    opacity: 0 !important;
    transition: opacity .18s ease !important;
    display: block !important;
  }

  .admin-aaa-body .aaa-toolbar-edge-fade-right {
    right: 0 !important;
    width: 112px !important;
    background:
      linear-gradient(90deg, rgba(4,8,30,0) 0%, rgba(4,8,30,.76) 44%, rgba(4,8,30,1) 100%),
      radial-gradient(circle at 72% 50%, rgba(78,139,255,.52), rgba(78,139,255,0) 62%) !important;
  }

  .admin-aaa-body .aaa-toolbar-edge-fade-right span {
    position: absolute !important;
    right: 14px !important;
    top: 23px !important;
    width: 30px !important;
    height: 44px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 999px !important;
    color: #fff !important;
    background: rgba(53,105,235,.86) !important;
    box-shadow: 0 0 20px rgba(75,136,255,.44) !important;
    font-size: 30px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
  }

  .admin-aaa-body .aaa-toolbar-edge-fade-left {
    left: 0 !important;
    width: 62px !important;
    background: linear-gradient(90deg, rgba(4,8,30,1) 0%, rgba(4,8,30,.78) 48%, rgba(4,8,30,0) 100%) !important;
  }

  .admin-aaa-body.toolbar-can-scroll-right .aaa-toolbar-edge-fade-right,
  .admin-aaa-body.toolbar-can-scroll-left .aaa-toolbar-edge-fade-left {
    opacity: 1 !important;
  }

  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-toolbar-edge-fade,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-toolbar-edge-fade {
    display: none !important;
  }
}

@media (min-width: 781px) {
  .aaa-toolbar-edge-fade { display: none !important; }
}

/* =========================================================
   FIX 11: MOBILE TOOLBAR VISIBLE EDGE FADE
   The toolbar scroll already works; this makes the right/left
   fade overlays visibly render above the toolbar on mobile.
   ========================================================= */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-toolbar-edge-fade {
    position: fixed !important;
    top: var(--aaa-mobile-topbar-height, 78px) !important;
    height: 84px !important;
    pointer-events: none !important;
    z-index: 4500 !important;
    display: block !important;
    transition: opacity .16s ease !important;
  }

  /* Default visible cue on the right because mobile users need to discover horizontal scroll. */
  .admin-aaa-body .aaa-toolbar-edge-fade-right {
    right: 0 !important;
    width: 118px !important;
    opacity: 1 !important;
    background:
      linear-gradient(90deg,
        rgba(4, 7, 25, 0) 0%,
        rgba(4, 7, 25, .62) 38%,
        rgba(4, 7, 25, .94) 72%,
        rgba(4, 7, 25, 1) 100%) !important;
  }

  .admin-aaa-body .aaa-toolbar-edge-fade-right::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    background: radial-gradient(circle at 86% 50%, rgba(73, 134, 255, .45), transparent 58%) !important;
  }

  .admin-aaa-body .aaa-toolbar-edge-fade-right span {
    position: absolute !important;
    right: 14px !important;
    top: 21px !important;
    width: 30px !important;
    height: 42px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 999px !important;
    color: #ffffff !important;
    background: rgba(49, 103, 238, .96) !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    box-shadow: 0 0 22px rgba(73, 134, 255, .55) !important;
    font-size: 30px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
  }

  .admin-aaa-body .aaa-toolbar-edge-fade-left {
    left: 0 !important;
    width: 76px !important;
    opacity: 0 !important;
    background:
      linear-gradient(90deg,
        rgba(4, 7, 25, 1) 0%,
        rgba(4, 7, 25, .86) 42%,
        rgba(4, 7, 25, 0) 100%) !important;
  }

  .admin-aaa-body.toolbar-can-scroll-left .aaa-toolbar-edge-fade-left {
    opacity: 1 !important;
  }

  .admin-aaa-body.toolbar-at-right .aaa-toolbar-edge-fade-right,
  .admin-aaa-body.toolbar-no-overflow .aaa-toolbar-edge-fade-right {
    opacity: 0 !important;
  }

  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-toolbar-edge-fade,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-toolbar-edge-fade {
    display: none !important;
  }
}


/* =========================================================
   MOBILE COLLAPSED ADMIN NAV
   Replaces the horizontal scroll/fade toolbar with a compact
   drop-down navigation list on mobile.
   ========================================================= */
.admin-aaa-body .aaa-mobile-nav-toggle {
  display: none;
}

@media (max-width: 900px) {
  body.admin-aaa-body {
    --aaa-mobile-topbar-height: 78px;
    --aaa-mobile-nav-collapsed-height: 72px;
  }

  .admin-aaa-body {
    padding-top: calc(var(--aaa-mobile-topbar-height) + var(--aaa-mobile-nav-collapsed-height)) !important;
  }

  .admin-aaa-body .aaa-toolbar-scroll-peek,
  .admin-aaa-body .aaa-toolbar-edge-fade,
  .admin-aaa-body .aaa-mobile-toolbar-fade,
  .admin-aaa-body .aaa-sidebar::after,
  .admin-aaa-body.toolbar-can-scroll-right .aaa-toolbar-edge-fade-right,
  .admin-aaa-body.toolbar-can-scroll-left .aaa-toolbar-edge-fade-left {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  .admin-aaa-body .aaa-sidebar {
    position: fixed !important;
    top: var(--aaa-mobile-topbar-height) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 2200 !important;
    width: 100% !important;
    height: var(--aaa-mobile-nav-collapsed-height) !important;
    max-height: var(--aaa-mobile-nav-collapsed-height) !important;
    min-height: var(--aaa-mobile-nav-collapsed-height) !important;
    padding: 10px 14px !important;
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) !important;
    grid-template-rows: 52px auto !important;
    align-items: center !important;
    gap: 0 12px !important;
    overflow: visible !important;
    background: rgba(4, 8, 30, 0.86) !important;
    border-bottom: 1px solid rgba(119, 150, 255, 0.22) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34) !important;
    backdrop-filter: blur(18px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open {
    height: auto !important;
    max-height: calc(100vh - var(--aaa-mobile-topbar-height) - 10px) !important;
  }

  .admin-aaa-body .aaa-logo-link {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    margin: 0 !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 52px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 0 16px !important;
    border: 1px solid rgba(133, 163, 255, 0.38) !important;
    border-radius: 18px !important;
    color: #fff !important;
    background: linear-gradient(135deg, rgba(39, 105, 255, 0.92), rgba(152, 58, 255, 0.92)) !important;
    box-shadow: 0 12px 30px rgba(56, 102, 255, 0.26) !important;
    font: inherit !important;
    font-weight: 700 !important;
    cursor: pointer !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle-icon,
  .admin-aaa-body .aaa-mobile-nav-toggle-chevron {
    flex: 0 0 auto !important;
    font-size: 20px !important;
    line-height: 1 !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle-text {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .admin-aaa-body .aaa-mobile-nav-open .aaa-mobile-nav-toggle-chevron {
    transform: rotate(180deg) !important;
  }

  .admin-aaa-body .aaa-sidebar-nav {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: none !important;
    width: 100% !important;
    margin: 12px 0 0 !important;
    padding: 8px !important;
    max-height: calc(100vh - var(--aaa-mobile-topbar-height) - var(--aaa-mobile-nav-collapsed-height) - 24px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border: 1px solid rgba(133, 163, 255, 0.28) !important;
    border-radius: 20px !important;

    /* Glass blur dropdown panel */
    background:
      linear-gradient(180deg, rgba(18, 29, 86, 0.72), rgba(6, 10, 42, 0.62)) !important;
    backdrop-filter: blur(18px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(150%) !important;

    box-shadow:
      0 18px 42px rgba(0, 0, 0, 0.36),
      inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  }

  .admin-aaa-body .aaa-mobile-nav-open .aaa-sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .admin-aaa-body .aaa-sidebar-bottom-link,
  .admin-aaa-body .sidebar-bottom-link.aaa-nav-link {
    display: none !important;
  }

  .admin-aaa-body .aaa-nav-link,
  .admin-aaa-body .sidebar-link.aaa-nav-link {
    width: 100% !important;
    min-width: 0 !important;
    height: 54px !important;
    min-height: 54px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    padding: 0 16px !important;
    border-radius: 16px !important;
    text-align: left !important;
  }

  .admin-aaa-body .aaa-nav-link svg {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
  }

  .admin-aaa-body .aaa-nav-link span {
    display: block !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }

  .admin-aaa-body .aaa-nav-link.active {
    background: linear-gradient(135deg, rgba(37, 101, 255, 0.92), rgba(128, 64, 255, 0.94)) !important;
    box-shadow: 0 10px 26px rgba(62, 99, 255, 0.28) !important;
  }

  .admin-aaa-body:has(.knowledge-editor-panel.open) .aaa-sidebar,
  .admin-aaa-body:has(.aaa-duplicate-overlay:not([hidden])) .aaa-sidebar {
    z-index: 1200 !important;
  }
}


/* =========================================================
   MOBILE COLLAPSED NAV LOGO REMOVAL + OPEN FIX
   Removes the extra logo beside the dropdown and makes the
   mobile nav open as a full-width vertical dropdown.
   ========================================================= */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar {
    grid-template-columns: 1fr !important;
    grid-template-rows: 52px auto !important;
    pointer-events: auto !important;
  }

  .admin-aaa-body .aaa-logo-link {
    display: none !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle {
    grid-column: 1 !important;
    grid-row: 1 !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 2 !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .aaa-sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open {
    overflow: visible !important;
  }
}


/* FINAL FIX: mobile dropdown actually opens, with no logo beside it. */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 52px auto !important;
    height: var(--aaa-mobile-nav-collapsed-height, 72px) !important;
    max-height: var(--aaa-mobile-nav-collapsed-height, 72px) !important;
    min-height: var(--aaa-mobile-nav-collapsed-height, 72px) !important;
    overflow: visible !important;
  }

  .admin-aaa-body .aaa-logo-link,
  .admin-aaa-body .aaa-lightning-logo {
    display: none !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle {
    display: flex !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    position: relative !important;
    z-index: 2302 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }

  .admin-aaa-body .aaa-sidebar-nav {
    display: none !important;
    grid-column: 1 !important;
    grid-row: 2 !important;
    pointer-events: none !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open,
  .admin-aaa-body.aaa-mobile-nav-is-open .aaa-sidebar {
    height: auto !important;
    max-height: calc(100vh - var(--aaa-mobile-topbar-height, 78px) - 8px) !important;
    overflow: visible !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .aaa-sidebar-nav,
  .admin-aaa-body.aaa-mobile-nav-is-open .aaa-sidebar .aaa-sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 2301 !important;
  }
}

/* =========================================================
   FINAL RELIABLE MOBILE DROPDOWN NAV OVERRIDE
   This keeps desktop sidebar unchanged and replaces the old
   mobile scroll toolbar with a true tap-to-open dropdown.
   ========================================================= */
@media (max-width: 900px) {
  .admin-aaa-body {
    --aaa-mobile-topbar-height: 78px;
    --aaa-mobile-nav-collapsed-height: 72px;
    padding-top: calc(var(--aaa-mobile-topbar-height) + var(--aaa-mobile-nav-collapsed-height)) !important;
  }

  .admin-aaa-body .aaa-toolbar-scroll-peek,
  .admin-aaa-body .aaa-toolbar-edge-fade,
  .admin-aaa-body .aaa-mobile-toolbar-fade,
  .admin-aaa-body .aaa-sidebar::before,
  .admin-aaa-body .aaa-sidebar::after,
  .admin-aaa-body .aaa-sidebar-nav::after {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .admin-aaa-body .aaa-sidebar {
    position: fixed !important;
    top: var(--aaa-mobile-topbar-height) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 3000 !important;
    width: 100% !important;
    height: var(--aaa-mobile-nav-collapsed-height) !important;
    min-height: var(--aaa-mobile-nav-collapsed-height) !important;
    max-height: var(--aaa-mobile-nav-collapsed-height) !important;
    padding: 10px 14px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 52px auto auto !important;
    align-items: start !important;
    overflow: visible !important;
    background: rgba(4, 8, 30, 0.86) !important;
    border-bottom: 1px solid rgba(119, 150, 255, 0.22) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34) !important;
    backdrop-filter: blur(18px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
    touch-action: manipulation !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open {
    height: auto !important;
    max-height: calc(100vh - var(--aaa-mobile-topbar-height) - 10px) !important;
    overflow: visible !important;
  }

  .admin-aaa-body .aaa-logo-link {
    display: none !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 52px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 0 16px !important;
    border: 1px solid rgba(133, 163, 255, 0.38) !important;
    border-radius: 18px !important;
    color: #fff !important;
    background: linear-gradient(135deg, rgba(39, 105, 255, 0.95), rgba(152, 58, 255, 0.95)) !important;
    box-shadow: 0 12px 30px rgba(56, 102, 255, 0.26) !important;
    font: inherit !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle-chevron {
    transition: transform 160ms ease !important;
  }

  .admin-aaa-body .aaa-mobile-nav-open .aaa-mobile-nav-toggle-chevron {
    transform: rotate(180deg) !important;
  }

  .admin-aaa-body .aaa-sidebar-nav,
  .admin-aaa-body .sidebar-bottom-link.aaa-nav-link {
    display: none !important;
  }

  .admin-aaa-body .aaa-mobile-nav-open .aaa-sidebar-nav {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 12px 0 0 !important;
    padding: 8px !important;
    max-height: calc(100vh - var(--aaa-mobile-topbar-height) - var(--aaa-mobile-nav-collapsed-height) - 90px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border: 1px solid rgba(133, 163, 255, 0.28) !important;
    border-radius: 20px 20px 0 0 !important;
    background: linear-gradient(180deg, rgba(10, 17, 54, 0.98), rgba(8, 12, 42, 0.98)) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36) !important;
  }

  .admin-aaa-body .aaa-mobile-nav-open .sidebar-bottom-link.aaa-nav-link {
    grid-column: 1 !important;
    grid-row: 3 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 54px !important;
    min-height: 54px !important;
    margin: 0 !important;
    padding: 0 24px !important;
    border: 1px solid rgba(133, 163, 255, 0.28) !important;
    border-top: 0 !important;
    border-radius: 0 0 20px 20px !important;
    background: rgba(10, 17, 54, 0.98) !important;
  }

  .admin-aaa-body .aaa-nav-link,
  .admin-aaa-body .sidebar-link.aaa-nav-link {
    width: 100% !important;
    min-width: 0 !important;
    height: 54px !important;
    min-height: 54px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    padding: 0 16px !important;
    border-radius: 16px !important;
    text-align: left !important;
  }

  .admin-aaa-body .aaa-nav-link svg {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
  }

  .admin-aaa-body .aaa-nav-link span {
    display: block !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }
}


/* =========================================================
   MOBILE DROPDOWN VISUAL FIX — compact vertical menu
   ========================================================= */
@media (max-width: 900px) {
  .admin-aaa-body {
    --aaa-mobile-topbar-height: 78px;
    --aaa-mobile-nav-collapsed-height: 72px;
    padding-top: calc(var(--aaa-mobile-topbar-height) + var(--aaa-mobile-nav-collapsed-height)) !important;
  }

  .admin-aaa-body .aaa-sidebar {
    position: fixed !important;
    top: var(--aaa-mobile-topbar-height) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 3000 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: var(--aaa-mobile-nav-collapsed-height) !important;
    min-height: var(--aaa-mobile-nav-collapsed-height) !important;
    max-height: var(--aaa-mobile-nav-collapsed-height) !important;
    padding: 10px 14px !important;
    display: block !important;
    overflow: visible !important;
    background: rgba(4, 8, 30, 0.96) !important;
    border-right: 0 !important;
    border-bottom: 1px solid rgba(119, 150, 255, 0.22) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open {
    height: auto !important;
    max-height: calc(100vh - var(--aaa-mobile-topbar-height) - 10px) !important;
  }

  .admin-aaa-body .aaa-logo-link {
    display: none !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle {
    width: 100% !important;
    height: 52px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 0 18px !important;
    border: 1px solid rgba(170, 190, 255, 0.34) !important;
    border-radius: 18px !important;
    color: #fff !important;
    background: linear-gradient(135deg, #286fff 0%, #5b4dff 56%, #a934ff 100%) !important;
    box-shadow: 0 12px 30px rgba(56, 102, 255, 0.24) !important;
    font: inherit !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle-text {
    flex: 1 1 auto !important;
    text-align: center !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle-icon,
  .admin-aaa-body .aaa-mobile-nav-toggle-chevron {
    flex: 0 0 24px !important;
    width: 24px !important;
    text-align: center !important;
    font-size: 22px !important;
    line-height: 1 !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle-chevron {
    transition: transform 160ms ease !important;
  }

  .admin-aaa-body .aaa-mobile-nav-open .aaa-mobile-nav-toggle-chevron {
    transform: rotate(180deg) !important;
  }

  .admin-aaa-body .aaa-sidebar:not(.aaa-mobile-nav-open) .aaa-sidebar-nav,
  .admin-aaa-body .aaa-sidebar:not(.aaa-mobile-nav-open) .aaa-admin-link {
    display: none !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .aaa-sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 12px 0 0 !important;
    padding: 10px !important;
    max-height: calc(100vh - var(--aaa-mobile-topbar-height) - var(--aaa-mobile-nav-collapsed-height) - 92px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border: 1px solid rgba(133, 163, 255, 0.24) !important;
    border-radius: 20px 20px 0 0 !important;
    background:
      radial-gradient(circle at 50% 0%, rgba(91, 77, 255, 0.14), transparent 42%),
      linear-gradient(180deg, rgba(10, 17, 54, 0.98), rgba(6, 10, 34, 0.98)) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36) !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .aaa-admin-link {
    display: flex !important;
    margin: 0 !important;
    border-radius: 0 0 20px 20px !important;
    border: 1px solid rgba(133, 163, 255, 0.24) !important;
    border-top: 0 !important;
    background: rgba(10, 17, 54, 0.98) !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .aaa-nav-link,
  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .sidebar-link.aaa-nav-link,
  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .sidebar-bottom-link.aaa-nav-link {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    padding: 0 18px !important;
    text-align: left !important;
    transform: none !important;
    border-radius: 15px !important;
    color: rgba(244, 248, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.035) !important;
    box-shadow: none !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .aaa-nav-link.active {
    background: linear-gradient(135deg, rgba(36, 126, 255, 0.94), rgba(103, 54, 255, 0.94)) !important;
    color: #fff !important;
    box-shadow: 0 10px 26px rgba(65, 91, 255, 0.24) !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .aaa-nav-link svg {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
    margin: 0 !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .aaa-nav-link span {
    display: block !important;
    flex: 1 1 auto !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    text-align: left !important;
  }
}


/* Compact mobile dropdown menu */
@media (max-width: 768px) {
  .aaa-sidebar-nav .aaa-nav-link svg,
  .aaa-sidebar-nav .sidebar-link svg,
  .aaa-sidebar-bottom-link svg,
  .aaa-admin-link svg {
    display: none !important;
  }

  .aaa-sidebar-nav .aaa-nav-link,
  .aaa-sidebar-nav .sidebar-link,
  .aaa-admin-link {
    gap: 0 !important;
    padding-left: 14px !important;
    min-height: 42px !important;
  }
}

/* Duplicate checker UI */
.aaa-duplicate-check-btn {
  min-height: 38px;
  padding: 0 14px !important;
  border-radius: 999px !important;
  white-space: nowrap;
}

.aaa-duplicate-results-modal {
  max-width: min(980px, calc(100vw - 28px));
}

.aaa-duplicate-results-body {
  display: grid;
  gap: 14px;
  max-height: min(62vh, 620px);
  overflow: auto;
  padding-right: 4px;
}

.aaa-duplicate-result-card {
  position: relative;
  border: 1px solid rgba(133, 163, 255, 0.22);
  border-radius: 18px;
  background: rgba(8, 14, 46, 0.72);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  padding: 14px;
}

.aaa-duplicate-result-score {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #dff7ff;
  background: rgba(53, 214, 255, 0.14);
  border: 1px solid rgba(53, 214, 255, 0.24);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.aaa-duplicate-result-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.aaa-duplicate-result-entry {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.aaa-duplicate-result-entry small {
  display: block;
  margin-bottom: 6px;
  color: rgba(225, 232, 255, 0.66);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
}

.aaa-duplicate-result-entry h3 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1rem;
}

.aaa-duplicate-result-entry p {
  margin: 10px 0 0;
  color: rgba(235, 241, 255, 0.78);
  line-height: 1.45;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .aaa-duplicate-check-btn {
    width: 100%;
    justify-content: center;
  }

  .aaa-duplicate-result-columns {
    grid-template-columns: 1fr;
  }
}

/* Dedicated duplicate check page */
.aaa-duplicates-page .aaa-duplicates-toolbar {
  margin-bottom: 18px;
}

.aaa-duplicates-mode-btn {
  width: auto !important;
  min-width: 132px;
  padding: 0 16px !important;
  font-size: 0.86rem;
  color: rgba(237, 241, 255, 0.78);
}

.aaa-duplicates-results {
  display: grid;
  gap: 18px;
}

.aaa-duplicate-section-heading {
  padding: 4px 2px 0;
}

.aaa-duplicate-section-heading h2 {
  margin: 0 0 4px;
  color: #ffffff;
  font-size: 1.05rem;
}

.aaa-duplicate-section-heading p {
  margin: 0;
  color: rgba(237, 241, 255, 0.68);
}

.aaa-duplicate-review-card {
  position: relative;
  padding: 54px 12px 14px;
  border: 1px solid rgba(94, 133, 255, 0.30);
  border-radius: 18px;
  background: rgba(12, 18, 55, 0.78);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.aaa-duplicate-review-score {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 12px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.38);
  color: #ecfeff;
  font-weight: 700;
  font-size: 0.82rem;
}

.aaa-duplicate-review-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.aaa-duplicate-review-column {
  min-height: 150px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.aaa-duplicate-review-column small {
  display: block;
  margin-bottom: 10px;
  color: rgba(237, 241, 255, 0.58);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.aaa-duplicate-review-column h3 {
  margin: 0 0 8px;
  color: #ffffff;
}

.aaa-duplicate-review-column .duplicate-content {
  margin-top: 14px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
}

@media (max-width: 768px) {
  .aaa-duplicates-mode-btn {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0 10px !important;
  }

  .aaa-duplicate-review-body {
    grid-template-columns: 1fr;
  }

  .aaa-duplicate-review-card {
    padding: 50px 10px 12px;
  }
}


.aaa-view-note {
  margin: 6px 0 0;
  color: rgba(230, 238, 255, 0.72);
  font-size: 0.92rem;
  line-height: 1.45;
}


/* Duplicate / data quality report expansion */
.aaa-duplicate-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.aaa-duplicate-summary-card {
  border: 1px solid rgba(123, 154, 255, 0.22);
  border-radius: 18px;
  background: rgba(19, 28, 78, 0.72);
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.aaa-duplicate-summary-card strong {
  display: block;
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  margin-bottom: 6px;
}

.aaa-duplicate-summary-card span {
  display: block;
  color: rgba(232, 239, 255, 0.74);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.aaa-duplicate-bucket {
  margin-top: 22px;
}

.aaa-duplicate-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}

.aaa-duplicate-section-heading h2 {
  margin: 0 0 4px;
}

.aaa-duplicate-section-heading p {
  margin: 0;
  color: rgba(232, 239, 255, 0.68);
}

.aaa-bucket-count {
  min-width: 42px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(73, 205, 255, 0.32);
  background: rgba(27, 129, 195, 0.22);
}

.aaa-duplicate-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.aaa-duplicate-type {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(63, 116, 255, 0.22);
  border: 1px solid rgba(95, 150, 255, 0.28);
}

.aaa-duplicate-source {
  margin-top: 6px;
  color: rgba(232, 239, 255, 0.6);
  font-size: 0.78rem;
  font-weight: 700;
}

.duplicate-source-subtitle,
.duplicate-match-source {
  color: #40506a;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.duplicate-source-subtitle {
  margin: -2px 0 7px;
}

.knowledge-card-subtitle {
  display: block;
  margin: -2px 0 10px;
  color: #526078;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.35;
}

.aaa-table-entry-title .knowledge-card-subtitle {
  margin: 3px 0 0;
  font-size: 0.75rem;
}

.field-optional {
  color: #778197;
  font-size: 0.75rem;
  font-weight: 500;
}

.admin-aaa-body .knowledge-section-path {
  margin: -2px 0 7px;
  color: #526078;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-aaa-body .knowledge-aliases,
.admin-aaa-body .knowledge-table-aliases {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  color: #667085;
  font-size: 0.72rem;
}

.admin-aaa-body .knowledge-aliases span {
  padding: 2px 7px;
  border: 1px solid #d9deea;
  border-radius: 999px;
  background: #f8fafc;
}

.admin-aaa-body .aaa-table-entry-category small {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 0.72rem;
  font-weight: 600;
}

.admin-aaa-body .status-badge.status-needs-update,
.admin-aaa-body .aaa-table-entry-status.needs-update {
  color: #9a4b08;
  border-color: #fed7aa;
  background: #fff7ed;
}

.admin-aaa-body .aaa-table-entry-status.needs-update > span {
  background: #f59e0b;
}

.admin-aaa-body .knowledge-editor-panel .aaa-aliases-input {
  min-height: 74px;
  resize: vertical;
}

.aaa-duplicate-review-card.is-conflict {
  border-color: rgba(255, 116, 116, 0.45) !important;
  box-shadow: 0 0 0 1px rgba(255, 116, 116, 0.12), 0 18px 44px rgba(0,0,0,0.22);
}

.aaa-duplicate-review-card.is-conflict .aaa-duplicate-type,
.aaa-duplicate-review-card.is-conflict .aaa-duplicate-review-score {
  background: rgba(255, 73, 94, 0.18);
  border-color: rgba(255, 116, 116, 0.42);
}

.aaa-duplicate-review-card.is-exact .aaa-duplicate-type,
.aaa-duplicate-review-card.is-exact .aaa-duplicate-review-score {
  background: rgba(25, 191, 122, 0.18);
  border-color: rgba(77, 255, 178, 0.34);
}

.aaa-duplicate-review-card.is-near .aaa-duplicate-type,
.aaa-duplicate-review-card.is-near .aaa-duplicate-review-score {
  background: rgba(255, 196, 73, 0.16);
  border-color: rgba(255, 210, 104, 0.35);
}

.aaa-duplicate-review-card.is-title-different .aaa-duplicate-type,
.aaa-duplicate-review-card.is-title-different .aaa-duplicate-review-score {
  background: rgba(181, 104, 255, 0.18);
  border-color: rgba(198, 139, 255, 0.38);
}

.aaa-duplicate-review-card.is-answer-same .aaa-duplicate-type,
.aaa-duplicate-review-card.is-answer-same .aaa-duplicate-review-score {
  background: rgba(73, 205, 255, 0.16);
  border-color: rgba(73, 205, 255, 0.34);
}

.aaa-duplicate-review-card.is-related .aaa-duplicate-type,
.aaa-duplicate-review-card.is-related .aaa-duplicate-review-score {
  background: rgba(122, 142, 196, 0.16);
  border-color: rgba(162, 184, 255, 0.28);
}

.aaa-duplicate-details {
  margin-top: 12px;
  border-top: 1px solid rgba(146, 170, 255, 0.14);
  padding-top: 10px;
}

.aaa-duplicate-details summary {
  cursor: pointer;
  color: rgba(236, 242, 255, 0.82);
  font-weight: 700;
}

.aaa-duplicate-reason-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  margin-top: 12px;
}

.aaa-shared-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.aaa-term-pill {
  border-radius: 999px;
  border: 1px solid rgba(130, 164, 255, 0.22);
  background: rgba(255,255,255,0.06);
  padding: 5px 8px;
  color: rgba(239, 244, 255, 0.84);
  font-size: 0.78rem;
  font-weight: 600;
}

.aaa-shared-empty {
  display: inline-block;
  margin-top: 8px;
  color: rgba(239, 244, 255, 0.54);
}

.aaa-facts-box {
  grid-column: 1 / -1;
  border-radius: 14px;
  border: 1px solid rgba(130, 164, 255, 0.16);
  background: rgba(255,255,255,0.045);
  padding: 10px 12px;
}

.aaa-facts-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  color: rgba(239, 244, 255, 0.76);
  font-size: 0.84rem;
}

.aaa-facts-row + .aaa-facts-row {
  margin-top: 6px;
}

@media (max-width: 900px) {
  .aaa-duplicate-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aaa-duplicate-reason-grid {
    grid-template-columns: 1fr;
  }

  .aaa-facts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .aaa-duplicate-summary-grid {
    grid-template-columns: 1fr;
  }

  .aaa-duplicate-card-top {
    flex-direction: column;
  }
}


/* Hide old duplicate source mode buttons */
.aaa-duplicates-mode-btn,
#knowledgeModeBtn,
#importsModeBtn,
#bothModeBtn {
  display: none !important;
}

/* Duplicate review action workflow */
.aaa-duplicate-review-score {
  min-width: 155px;
  text-align: right;
}

.aaa-smart-match-label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.aaa-smart-match-label strong {
  font-size: 13px;
  color: inherit;
}

.aaa-smart-match-label em {
  font-style: normal;
  font-weight: 600;
  opacity: .88;
}

.aaa-smart-match-help {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  opacity: .72;
}

.aaa-shared-panel {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px solid rgba(90, 112, 132, .18);
  border-radius: 14px;
  background: rgba(246, 249, 252, .82);
}

.aaa-shared-panel strong {
  display: block;
  margin-bottom: 8px;
  color: #263647;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.aaa-duplicate-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px 2px;
}

.aaa-duplicate-action-row button {
  min-height: 38px;
}

.aaa-merge-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 22, 34, .62);
  backdrop-filter: blur(8px);
}

.aaa-merge-modal-overlay[hidden] {
  display: none;
}

.aaa-merge-modal {
  width: min(1120px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: #f7fafc;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
}

.aaa-merge-header,
.aaa-merge-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
}

.aaa-merge-header {
  color: #fff;
  background: linear-gradient(135deg, #14293c 0%, #203f59 100%);
}

.aaa-merge-header h2 {
  margin: 0 0 4px;
  color: #fff;
}

.aaa-merge-header p,
.aaa-merge-actions span {
  margin: 0;
  color: rgba(255, 255, 255, .78);
}

.aaa-merge-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 22px 8px;
}

.aaa-merge-source-card,
.aaa-merge-preview {
  border: 1px solid rgba(90, 112, 132, .18);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 36, 51, .06);
}

.aaa-merge-source-card {
  padding: 16px;
}

.aaa-merge-source-card small {
  display: block;
  margin-bottom: 7px;
  color: #65778a;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.aaa-merge-source-card h3 {
  margin: 0 0 8px;
  color: #1f3346;
}

.aaa-merge-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 22px;
}

.aaa-merge-choice-row .is-active-choice {
  transform: translateY(-1px);
}

.aaa-merge-preview {
  margin: 4px 22px 18px;
  padding: 16px;
}

.aaa-merge-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #24384c;
}

.aaa-merge-preview-heading span {
  color: #6d7d8d;
  font-size: 12px;
  font-weight: 700;
}

.aaa-merge-preview label {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  color: #32465a;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.aaa-merge-preview input,
.aaa-merge-preview textarea {
  width: 100%;
  border: 1px solid rgba(90, 112, 132, .24);
  border-radius: 12px;
  padding: 11px 12px;
  color: #1c2f42;
  background: #eef5fb;
  font: inherit;
  line-height: 1.45;
  text-transform: none;
}

.aaa-merge-preview textarea {
  resize: vertical;
  min-height: 170px;
}

.aaa-merge-actions {
  border-top: 1px solid rgba(90, 112, 132, .16);
  background: #172d42;
}

.aaa-merge-actions span {
  color: rgba(255, 255, 255, .82);
  font-weight: 700;
}

@media (max-width: 820px) {
  .aaa-duplicate-review-score {
    width: 100%;
    text-align: left;
  }

  .aaa-smart-match-label {
    justify-content: flex-start;
  }

  .aaa-duplicate-action-row {
    justify-content: stretch;
  }

  .aaa-duplicate-action-row button {
    flex: 1 1 100%;
  }

  .aaa-merge-modal-overlay {
    padding: 10px;
  }

  .aaa-merge-compare-grid {
    grid-template-columns: 1fr;
  }

  .aaa-merge-header,
  .aaa-merge-actions,
  .aaa-merge-choice-row,
  .aaa-merge-compare-grid {
    padding-left: 14px;
    padding-right: 14px;
  }

  .aaa-merge-preview {
    margin-left: 14px;
    margin-right: 14px;
  }

  .aaa-merge-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
.aaa-shared-panel .aaa-term-pill {
  color: #25394d;
  background: #e7f0f8;
  border-color: rgba(58, 91, 122, .16);
}
.aaa-shared-panel .aaa-shared-empty {
  color: #687b8d;
}

/* Theme-aligned duplicate merge/review modal */
.aaa-merge-modal-overlay {
  background: rgba(3, 8, 24, 0.72);
  backdrop-filter: blur(10px);
}

.aaa-merge-modal {
  border: 1px solid rgba(123, 154, 255, 0.28);
  background: linear-gradient(180deg, rgba(11, 18, 48, 0.98) 0%, rgba(8, 13, 35, 0.98) 100%);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  color: rgba(236, 242, 255, 0.9);
}

.aaa-merge-header {
  border-bottom: 1px solid rgba(123, 154, 255, 0.20);
  background: linear-gradient(135deg, rgba(17, 31, 76, 0.96) 0%, rgba(18, 48, 88, 0.96) 100%);
}

.aaa-merge-header h2,
.aaa-merge-preview-heading strong,
.aaa-merge-source-card h3 {
  color: #ffffff;
}

.aaa-merge-header p,
.aaa-merge-source-card .duplicate-meta,
.aaa-merge-preview-heading span {
  color: rgba(232, 239, 255, 0.68);
}

.aaa-merge-source-card,
.aaa-merge-preview {
  border: 1px solid rgba(123, 154, 255, 0.22);
  background: rgba(19, 28, 78, 0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 42px rgba(0, 0, 0, 0.18);
}

.aaa-merge-source-card small,
.aaa-merge-preview label {
  color: rgba(170, 190, 230, 0.88);
}

.aaa-merge-source-card .duplicate-content {
  border: 1px solid rgba(130, 164, 255, 0.14);
  background: rgba(255,255,255,0.045);
  color: rgba(239, 244, 255, 0.88);
}

.aaa-merge-choice-row {
  border-top: 1px solid rgba(146, 170, 255, 0.10);
}

.aaa-merge-choice-row .secondary-btn,
.aaa-merge-header .secondary-btn,
.aaa-merge-actions .secondary-btn {
  border-color: rgba(130, 164, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.aaa-merge-choice-row .secondary-btn:hover,
.aaa-merge-header .secondary-btn:hover,
.aaa-merge-actions .secondary-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.aaa-merge-choice-row .is-active-choice {
  box-shadow: 0 0 0 2px rgba(73, 205, 255, 0.24), 0 16px 34px rgba(0,0,0,0.28);
}

.aaa-merge-preview input,
.aaa-merge-preview textarea {
  border: 1px solid rgba(130, 164, 255, 0.24);
  background: rgba(7, 13, 35, 0.72);
  color: #f6f9ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.aaa-merge-preview input:focus,
.aaa-merge-preview textarea:focus {
  outline: none;
  border-color: rgba(73, 205, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(73, 205, 255, 0.14);
}

.aaa-merge-actions {
  border-top: 1px solid rgba(123, 154, 255, 0.20);
  background: rgba(9, 15, 40, 0.96);
}

.aaa-merge-actions span {
  color: rgba(232, 239, 255, 0.78);
}


/* AAA Duplicate Detection redesign */
.admin-aaa-body .aaa-duplicates-page .aaa-content-header h1 {
  letter-spacing: -0.02em;
}

.admin-aaa-body .aaa-duplicate-bucket {
  margin-top: 26px;
}

.admin-aaa-body .aaa-duplicate-workspace {
  padding: 0 !important;
  overflow: hidden;
  border-color: rgba(94, 133, 255, 0.28) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(63, 116, 255, 0.18), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(191, 52, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(10, 16, 47, 0.96), rgba(8, 13, 35, 0.98));
  box-shadow: 0 22px 60px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.055);
}

.admin-aaa-body .aaa-duplicate-workspace::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.44;
  background-image:
    linear-gradient(120deg, transparent 0 44%, rgba(103, 139, 255, 0.10) 45%, transparent 52%),
    radial-gradient(circle at 94% 8%, rgba(73, 205, 255, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 86% 28%, rgba(73, 205, 255, 0.14) 0 1px, transparent 2px);
}

.admin-aaa-body .aaa-duplicate-workspace-header,
.admin-aaa-body .aaa-duplicate-workspace-grid {
  position: relative;
  z-index: 1;
}

.admin-aaa-body .aaa-duplicate-workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(146, 170, 255, 0.13);
}

.admin-aaa-body .aaa-duplicate-page-kicker {
  margin-bottom: 8px;
  color: rgba(170, 190, 230, 0.76);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-aaa-body .aaa-duplicate-headline-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #fff;
  font-size: 1rem;
}

.admin-aaa-body .aaa-duplicate-headline-row em {
  color: #ff5470;
  font-style: normal;
  font-weight: 700;
}

.admin-aaa-body .aaa-duplicate-signal-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff375f, #ff6f86);
  box-shadow: 0 0 24px rgba(255, 55, 95, 0.45);
}

.admin-aaa-body .aaa-duplicate-workspace-header p {
  margin: 8px 0 0;
  color: rgba(232, 239, 255, 0.72);
  line-height: 1.45;
}

.admin-aaa-body .aaa-duplicate-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-aaa-body .aaa-duplicate-header-actions span {
  color: rgba(232, 239, 255, 0.58);
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-aaa-body .aaa-duplicate-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  padding: 14px;
}

.admin-aaa-body .aaa-duplicate-left-panel {
  min-width: 0;
}

.admin-aaa-body .aaa-duplicate-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-aaa-body .aaa-duplicate-workspace .aaa-duplicate-review-column {
  min-height: 210px;
  padding: 18px;
  border: 1px solid rgba(130, 164, 255, 0.18);
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.055);
}

.admin-aaa-body .aaa-entry-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-aaa-body .aaa-entry-card-top small {
  margin: 0;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(63, 116, 255, 0.20);
  color: #70a7ff;
  letter-spacing: 0.06em;
}

.admin-aaa-body .aaa-entry-card-b .aaa-entry-card-top small {
  background: rgba(181, 104, 255, 0.18);
  color: #bf8cff;
}

.admin-aaa-body .aaa-entry-card-top span {
  color: rgba(232, 239, 255, 0.54);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-aaa-body .aaa-duplicate-workspace .duplicate-meta {
  color: rgba(232, 239, 255, 0.70);
}

.admin-aaa-body .aaa-duplicate-workspace .duplicate-content,
.admin-aaa-body .aaa-merge-source-card .duplicate-content {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(130, 164, 255, 0.16);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  color: rgba(245, 248, 255, 0.88);
  font-size: 0.94rem;
  font-weight: 400 !important;
  line-height: 1.55;
  white-space: pre-wrap;
}

.admin-aaa-body .aaa-duplicate-primary-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 0 0;
}

.admin-aaa-body .aaa-duplicate-primary-actions button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 58px;
  border-radius: 12px;
  text-align: center;
}

.admin-aaa-body .aaa-duplicate-primary-actions button strong {
  font-size: 0.92rem;
  color: #fff;
}

.admin-aaa-body .aaa-duplicate-primary-actions button span {
  color: rgba(232,239,255,0.66);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-aaa-body .aaa-duplicate-analysis-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(130, 164, 255, 0.20);
  border-radius: 16px;
  background: rgba(15, 23, 60, 0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.055);
}

.admin-aaa-body .aaa-analysis-title,
.admin-aaa-body .aaa-analysis-block > strong {
  color: rgba(170, 190, 230, 0.86);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-aaa-body .aaa-analysis-score-line {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  margin: 16px 0 10px;
}

.admin-aaa-body .aaa-analysis-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(63, 116, 255, 0.22);
  border: 1px solid rgba(90, 150, 255, 0.25);
}

.admin-aaa-body .aaa-analysis-score-line strong {
  display: block;
  color: #ff5470;
  font-size: 1.25rem;
  line-height: 1;
}

.admin-aaa-body .aaa-analysis-score-line em {
  display: block;
  margin-top: 5px;
  color: rgba(232,239,255,0.72);
  font-style: normal;
  font-weight: 600;
}

.admin-aaa-body .aaa-duplicate-analysis-panel p {
  color: rgba(232,239,255,0.74);
  line-height: 1.45;
}

.admin-aaa-body .aaa-analysis-divider {
  height: 1px;
  margin: 16px 0;
  background: rgba(146, 170, 255, 0.15);
}

.admin-aaa-body .aaa-analysis-block + .aaa-analysis-block {
  margin-top: 16px;
}

.admin-aaa-body .aaa-analysis-block ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: rgba(232,239,255,0.76);
  line-height: 1.45;
}

.admin-aaa-body .aaa-analysis-panel .aaa-shared-terms,
.admin-aaa-body .aaa-duplicate-analysis-panel .aaa-shared-terms {
  margin-top: 10px;
}

.admin-aaa-body .aaa-duplicate-analysis-panel .aaa-term-pill {
  background: rgba(255,255,255,0.07);
  color: rgba(239,244,255,0.86);
  border-color: rgba(130, 164, 255, 0.18);
}

.admin-aaa-body .aaa-duplicate-workspace .aaa-duplicate-details {
  margin-top: 16px;
  padding-top: 14px;
}

.admin-aaa-body .aaa-duplicate-workspace .aaa-duplicate-reason-grid {
  grid-template-columns: 1fr;
}

/* Make merge/edit text comfortable to read */
.admin-aaa-body .aaa-merge-preview textarea,
.admin-aaa-body .aaa-merge-preview input {
  font-weight: 400 !important;
  letter-spacing: 0;
}

.admin-aaa-body .aaa-merge-preview textarea {
  min-height: 190px;
  line-height: 1.55;
}

.admin-aaa-body .aaa-merge-source-card .duplicate-content {
  max-height: 180px;
  overflow: auto;
}

@media (max-width: 1180px) {
  .admin-aaa-body .aaa-duplicate-workspace-grid {
    grid-template-columns: 1fr;
  }

  .admin-aaa-body .aaa-duplicate-analysis-panel {
    order: -1;
  }
}

@media (max-width: 860px) {
  .admin-aaa-body .aaa-duplicate-workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-aaa-body .aaa-duplicate-entry-grid,
  .admin-aaa-body .aaa-duplicate-primary-actions {
    grid-template-columns: 1fr;
  }
}

/* Duplicate Detection refinements: sticky jump nav, action placement, comparison colors */
.admin-aaa-body .aaa-duplicate-jump-nav {
  position: sticky;
  top: 86px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  padding: 10px;
  border: 1px solid rgba(112, 151, 255, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(8, 14, 45, 0.92), rgba(11, 18, 55, 0.86));
  box-shadow: 0 18px 45px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
}

.admin-aaa-body .aaa-duplicate-jump-nav span {
  padding: 0 8px;
  color: rgba(214, 225, 255, 0.70);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.admin-aaa-body .aaa-duplicate-jump-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(132, 164, 255, 0.22);
  border-radius: 999px;
  background: rgba(238, 244, 255, 0.08);
  color: rgba(246, 250, 255, 0.92);
  text-decoration: none;
  font-size: 0.86rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.admin-aaa-body .aaa-duplicate-jump-nav a:hover {
  transform: translateY(-1px);
  border-color: rgba(72, 153, 255, 0.62);
  background: rgba(28, 119, 255, 0.18);
}

.admin-aaa-body .aaa-duplicate-jump-nav a em {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(34, 132, 255, 0.26);
  color: #dff2ff;
  font-style: normal;
  font-weight: 700;
  font-size: 0.78rem;
}

.admin-aaa-body .aaa-duplicate-bucket {
  scroll-margin-top: 160px;
}

.admin-aaa-body .aaa-duplicate-primary-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-aaa-body .aaa-duplicate-primary-actions:has(.aaa-auto-merge-btn) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-aaa-body .aaa-duplicate-workspace .aaa-entry-card-a,
.admin-aaa-body .aaa-merge-source-card:first-child {
  border-color: rgba(69, 154, 255, 0.42) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(38, 132, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(17, 35, 78, 0.72), rgba(11, 19, 50, 0.82)) !important;
}

.admin-aaa-body .aaa-duplicate-workspace .aaa-entry-card-b,
.admin-aaa-body .aaa-merge-source-card:nth-child(2) {
  border-color: rgba(42, 216, 151, 0.38) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(42, 216, 151, 0.15), transparent 34%),
    linear-gradient(180deg, rgba(12, 50, 58, 0.60), rgba(11, 26, 49, 0.84)) !important;
}

.admin-aaa-body .aaa-entry-card-a .aaa-entry-card-top small,
.admin-aaa-body .aaa-merge-source-card:first-child small {
  background: rgba(45, 141, 255, 0.23) !important;
  color: #8fc7ff !important;
  border: 1px solid rgba(92, 172, 255, 0.22);
}

.admin-aaa-body .aaa-entry-card-b .aaa-entry-card-top small,
.admin-aaa-body .aaa-merge-source-card:nth-child(2) small {
  background: rgba(42, 216, 151, 0.18) !important;
  color: #8bf2ca !important;
  border: 1px solid rgba(42, 216, 151, 0.22);
}

.admin-aaa-body .aaa-keep-a-btn {
  border-color: rgba(91, 173, 255, 0.54) !important;
  background: linear-gradient(135deg, rgba(34, 126, 255, 0.28), rgba(18, 42, 93, 0.82)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 12px 25px rgba(28,119,255,0.12);
}

.admin-aaa-body .aaa-keep-b-btn {
  border-color: rgba(45, 214, 151, 0.48) !important;
  background: linear-gradient(135deg, rgba(29, 190, 128, 0.24), rgba(14, 60, 70, 0.82)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 12px 25px rgba(41,217,139,0.10);
}

.admin-aaa-body .aaa-merge-review-btn,
.admin-aaa-body .aaa-merge-choice-row [data-choice="combine_both"].primary-btn {
  background: linear-gradient(100deg, #1677ff, #1f8dff 58%, #32b7ff) !important;
  border-color: rgba(164, 218, 255, 0.45) !important;
  box-shadow: 0 16px 34px rgba(23, 105, 255, 0.24), 0 0 26px rgba(50, 183, 255, 0.16) !important;
}

.admin-aaa-body .aaa-dismiss-match-btn {
  border-color: rgba(214, 225, 255, 0.25) !important;
  background: rgba(238, 244, 255, 0.10) !important;
}

.admin-aaa-body .aaa-auto-merge-btn {
  background: linear-gradient(100deg, #10b981, #21d19a) !important;
  border-color: rgba(123, 255, 205, 0.38) !important;
  box-shadow: 0 14px 30px rgba(16,185,129,0.18) !important;
}

/* Keep the merge/edit window readable: final result fields should not be bold. */
.admin-aaa-body #mergeCategoryInput,
.admin-aaa-body #mergeTitleInput,
.admin-aaa-body #mergeContentInput,
.admin-aaa-body .aaa-merge-preview textarea,
.admin-aaa-body .aaa-merge-preview input {
  font-weight: 400 !important;
  font-family: inherit;
  color: rgba(248, 251, 255, 0.92) !important;
}

.admin-aaa-body #mergeContentInput {
  font-size: 0.96rem;
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .admin-aaa-body .aaa-duplicate-primary-actions,
  .admin-aaa-body .aaa-duplicate-primary-actions:has(.aaa-auto-merge-btn) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-aaa-body .aaa-duplicate-jump-nav {
    top: 74px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .admin-aaa-body .aaa-duplicate-jump-nav a,
  .admin-aaa-body .aaa-duplicate-jump-nav span {
    flex: 0 0 auto;
  }
}

@media (max-width: 720px) {
  .admin-aaa-body .aaa-duplicate-primary-actions,
  .admin-aaa-body .aaa-duplicate-primary-actions:has(.aaa-auto-merge-btn) {
    grid-template-columns: 1fr;
  }
}

/* Duplicate comparison color update: neutral desaturated teal for A, indigo for B */
.admin-aaa-body {
  --duplicate-entry-a-accent: #2d73dc;
  --duplicate-entry-a-soft: rgba(45,115,220,0.20);
  --duplicate-entry-a-bg: rgba(45,115,220,0.10);
  --duplicate-entry-a-border: rgba(45,115,220,0.55);
  --duplicate-entry-b-accent: #744dff;
  --duplicate-entry-b-soft: rgba(116,77,255,0.22);
  --duplicate-entry-b-bg: rgba(116,77,255,0.11);
  --duplicate-entry-b-border: rgba(116,77,255,0.58);
}

.admin-aaa-body .aaa-duplicate-workspace .aaa-entry-card-a,
.admin-aaa-body .aaa-merge-source-card:first-child {
  border-color: var(--duplicate-entry-a-border) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(45,115,220,0.32), transparent 36%),
    linear-gradient(180deg, rgba(14,48,110,0.75), rgba(11, 19, 50, 0.84)) !important;
}

.admin-aaa-body .aaa-duplicate-workspace .aaa-entry-card-b,
.admin-aaa-body .aaa-merge-source-card:nth-child(2) {
  border-color: var(--duplicate-entry-b-border) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(116,77,255,0.34), transparent 36%),
    linear-gradient(180deg, rgba(52,31,122,0.78), rgba(11, 19, 50, 0.84)) !important;
}

.admin-aaa-body .aaa-entry-card-a .aaa-entry-card-top small,
.admin-aaa-body .aaa-merge-source-card:first-child small {
  background: var(--duplicate-entry-a-soft) !important;
  color: #9fc8ff !important;
  border: 1px solid rgba(124, 192, 199, 0.30) !important;
}

.admin-aaa-body .aaa-entry-card-b .aaa-entry-card-top small,
.admin-aaa-body .aaa-merge-source-card:nth-child(2) small {
  background: var(--duplicate-entry-b-soft) !important;
  color: #c5c8ff !important;
  border: 1px solid rgba(154, 159, 221, 0.32) !important;
}

.admin-aaa-body .aaa-keep-a-btn,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_a"] {
  border-color: rgba(124, 192, 199, 0.48) !important;
  background: linear-gradient(135deg, rgba(79, 143, 150, 0.30), rgba(19, 51, 63, 0.84)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 12px 25px rgba(79,143,150,0.13) !important;
}

.admin-aaa-body .aaa-keep-a-btn:hover,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_a"]:hover {
  border-color: rgba(154, 218, 224, 0.68) !important;
  background: linear-gradient(135deg, rgba(79, 143, 150, 0.40), rgba(22, 62, 74, 0.90)) !important;
}

.admin-aaa-body .aaa-keep-b-btn,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_b"] {
  border-color: rgba(154, 159, 221, 0.50) !important;
  background: linear-gradient(135deg, rgba(107, 111, 180, 0.33), rgba(29, 33, 77, 0.86)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 12px 25px rgba(107,111,180,0.14) !important;
}

.admin-aaa-body .aaa-keep-b-btn:hover,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_b"]:hover {
  border-color: rgba(190, 194, 255, 0.70) !important;
  background: linear-gradient(135deg, rgba(107, 111, 180, 0.43), rgba(35, 39, 91, 0.92)) !important;
}


/* Entry comparison colors updated */
.aaa-entry-a,
.duplicate-entry-a,
.aaa-duplicate-entry-a{
  background: rgba(74,134,217,.08) !important;
  border:1px solid rgba(74,134,217,.35) !important;
}
.aaa-entry-b,
.duplicate-entry-b,
.aaa-duplicate-entry-b{
  background: rgba(138,99,232,.08) !important;
  border:1px solid rgba(138,99,232,.35) !important;
}

.aaa-keep-a-btn{
  background: rgba(74,134,217,.15) !important;
  border-color: rgba(74,134,217,.45) !important;
}
.aaa-keep-b-btn{
  background: rgba(138,99,232,.15) !important;
  border-color: rgba(138,99,232,.45) !important;
}
.aaa-keep-a-btn strong,.aaa-keep-b-btn strong{
  font-weight: 600;
}

/* Top bar brand cleanup: sidebar owns the InstInt brand, top bar keeps branch/location only. */
.admin-aaa-body .aaa-logo-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 96px;
  padding-bottom: 14px;
}

.admin-aaa-body .aaa-logo-link .aaa-lightning-logo {
  width: 46px;
  height: 58px;
}

.admin-aaa-body .aaa-sidebar-logo-text {
  display: block;
  color: rgba(244, 248, 255, 0.92);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 0 16px rgba(80, 145, 255, 0.45);
}

.admin-aaa-body .aaa-topbar-branch-only {
  gap: 0;
}

.admin-aaa-body .aaa-topbar-branch-only .aaa-topbar-title,
.admin-aaa-body .aaa-topbar-branch-only.topbar-title {
  margin-left: 0;
}

@media (max-width: 900px) {
  .admin-aaa-body .aaa-logo-link {
    height: 68px !important;
    min-width: 78px;
    gap: 3px;
    padding-bottom: 0 !important;
  }

  .admin-aaa-body .aaa-logo-link .aaa-lightning-logo {
    width: 30px !important;
    height: 40px !important;
  }

  .admin-aaa-body .aaa-sidebar-logo-text {
    font-size: 11px;
  }
}

/* Streamlined Knowledge Manager table view update */
.admin-aaa-body .aaa-content-area {
  gap: 22px;
}

.admin-aaa-body .aaa-content-header h1 {
  letter-spacing: -0.045em;
}

.admin-aaa-body .aaa-view-actions {
  background: rgba(7, 13, 42, 0.76);
  box-shadow: none;
}

.admin-aaa-body .aaa-view-btn {
  width: auto;
  min-width: 92px;
  padding: 0 14px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
}

.admin-aaa-body .aaa-view-btn span {
  font-size: 14px;
  font-weight: 700;
}

.admin-aaa-body .aaa-view-btn.active {
  background: rgba(77, 91, 255, 0.82);
  box-shadow: none;
}

.admin-aaa-body .aaa-association-manager {
  min-height: auto;
  padding: 18px 22px;
  border-radius: 14px;
  background: rgba(13, 22, 58, 0.82);
  border-color: rgba(135, 156, 255, 0.24);
  box-shadow: none;
}

.admin-aaa-body .aaa-association-manager .aaa-section-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: none;
}

.admin-aaa-body .aaa-association-list,
.admin-aaa-body .association-list {
  min-height: 34px;
  padding: 0;
  background: transparent;
}

.admin-aaa-body .aaa-knowledge-table-view,
.admin-aaa-body .knowledge-grid.aaa-knowledge-table-view {
  display: block !important;
}

.admin-aaa-body .aaa-knowledge-table-shell {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(136, 158, 255, 0.26);
  border-radius: 16px;
  background: rgba(7, 12, 38, 0.82);
  box-shadow: none;
}

.admin-aaa-body .aaa-knowledge-table-header,
.admin-aaa-body .aaa-table-entry-row {
  display: grid;
  grid-template-columns: 210px minmax(190px, 0.9fr) minmax(300px, 1.9fr) 116px 128px 82px;
  align-items: center;
}

.admin-aaa-body .aaa-knowledge-table-header {
  min-height: 44px;
  padding: 0 18px;
  color: rgba(232, 238, 255, 0.76);
  background: rgba(20, 34, 78, 0.92);
  border-bottom: 1px solid rgba(136, 158, 255, 0.22);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.admin-aaa-body .aaa-table-category-group {
  display: block;
}

.admin-aaa-body .aaa-table-category-row {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid rgba(136, 158, 255, 0.18);
  padding: 0 18px;
  color: #ffffff;
  background: rgba(25, 42, 94, 0.78);
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) auto;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.admin-aaa-body .aaa-table-category-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-aaa-body .aaa-table-category-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.admin-aaa-body .aaa-table-category-meta {
  color: rgba(220, 229, 255, 0.72);
  font-size: 13px;
  font-weight: 600;
}

.admin-aaa-body .aaa-table-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.16s ease;
}

.admin-aaa-body .aaa-table-category-group:not(.expanded) .aaa-table-chevron {
  transform: rotate(-90deg);
}

.admin-aaa-body .aaa-table-category-group:not(.expanded) .aaa-table-category-entries {
  display: none;
}

.admin-aaa-body .aaa-table-entry-row {
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(136, 158, 255, 0.11);
  color: rgba(248, 251, 255, 0.88);
  font-size: 14px;
}

.admin-aaa-body .aaa-table-category-group:last-child .aaa-table-entry-row:last-child {
  border-bottom: 0;
}

.admin-aaa-body .aaa-table-entry-row:nth-child(odd) {
  background: rgba(10, 18, 52, 0.58);
}

.admin-aaa-body .aaa-table-entry-row:nth-child(even) {
  background: rgba(15, 27, 66, 0.74);
}

.admin-aaa-body .aaa-table-entry-row:hover {
  background: rgba(39, 63, 128, 0.58);
}

.admin-aaa-body .aaa-table-entry-category,
.admin-aaa-body .aaa-table-entry-title,
.admin-aaa-body .aaa-table-entry-preview,
.admin-aaa-body .aaa-table-entry-updated {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 18px;
}

.admin-aaa-body .aaa-table-entry-category {
  color: rgba(224, 232, 255, 0.64);
  font-weight: 600;
}

.admin-aaa-body .aaa-table-entry-title {
  color: #ffffff;
  font-weight: 700;
}

.admin-aaa-body .aaa-table-entry-preview {
  color: rgba(230, 237, 255, 0.76);
  font-weight: 600;
}

.admin-aaa-body .aaa-table-entry-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(248, 251, 255, 0.86);
  font-weight: 700;
}

.admin-aaa-body .aaa-table-entry-status span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--aaa-green);
}

.admin-aaa-body .aaa-table-entry-status.inactive span {
  background: rgba(248, 251, 255, 0.36);
}

.admin-aaa-body .aaa-table-entry-updated {
  color: rgba(224, 232, 255, 0.68);
  font-weight: 600;
}

.admin-aaa-body .aaa-table-entry-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-aaa-body .aaa-table-action-btn {
  min-width: 58px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(132, 157, 255, 0.28);
  border-radius: 9px;
  color: #dbe7ff;
  background: rgba(238, 244, 255, 0.07);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

.admin-aaa-body .aaa-table-action-btn:hover {
  background: rgba(238, 244, 255, 0.10);
}

@media (max-width: 1180px) {
  .admin-aaa-body .aaa-knowledge-table-shell {
    overflow-x: auto;
  }

  .admin-aaa-body .aaa-knowledge-table-header,
  .admin-aaa-body .aaa-table-entry-row {
    min-width: 980px;
  }
}

@media (max-width: 760px) {
  .admin-aaa-body .aaa-view-btn {
    min-width: 72px;
  }

  .admin-aaa-body .aaa-view-btn span {
    display: none;
  }

  .admin-aaa-body .aaa-association-manager {
    padding: 16px;
  }
}


/* Knowledge editor delete button matches the Imports delete-selected danger style. */
.admin-aaa-body .knowledge-editor-panel .panel-actions {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.admin-aaa-body .aaa-editor-delete-btn {
  background: rgba(255, 71, 118, 0.12) !important;
  color: #ffd0db !important;
  border: 1px solid rgba(255, 71, 118, 0.38) !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-editor-delete-btn:hover {
  background: rgba(255, 71, 118, 0.18) !important;
  color: #ffffff !important;
}

/* Streamlined category cards: remove unused letter icon space. */
.admin-aaa-body .aaa-category-card,
.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card {
  grid-template-columns: minmax(0, 1fr) auto 28px !important;
}

.admin-aaa-body .aaa-category-card-icon,
.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-icon {
  display: none !important;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-copy {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-count {
  grid-column: 2 !important;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-chevron {
  grid-column: 3 !important;
}

@media (max-width: 900px) {
  .admin-aaa-body .aaa-category-card,
  .admin-aaa-body .aaa-category-card-grid-item .aaa-category-card {
    grid-template-columns: minmax(0, 1fr) 24px !important;
  }
}


/* =========================================================
   CARD VIEW MINI-TABLE PREVIEW — COMPACT, SAFE UPDATE
   Keeps card layout stable while making previews scan like the table view.
   ========================================================= */
.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-copy {
  grid-row: 1 / -1 !important;
  align-self: start !important;
  padding-top: 0 !important;
  padding-right: 82px !important;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-copy strong {
  font-size: 21px !important;
  line-height: 1.12 !important;
  margin: 0 !important;
}

.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-copy > span {
  margin-top: 4px !important;
  margin-bottom: 8px !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
}

.admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table {
  margin-top: 8px !important;
  max-height: 132px !important;
  display: block !important;
  overflow-y: auto !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(238, 244, 255, 0.12) !important;
  background: rgba(8, 13, 41, 0.34) !important;
  mask-image: none !important;
}

.admin-aaa-body .aaa-category-mini-table-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 66px 64px !important;
  align-items: center !important;
  min-height: 24px !important;
  gap: 8px !important;
  padding: 0 10px 0 38px !important;
  border-bottom: 1px solid rgba(119, 143, 205, 0.22) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: rgba(221, 229, 255, 0.58) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.035em !important;
}

.admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table .aaa-category-preview-line {
  min-height: 28px !important;
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) 66px 64px !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(119, 143, 205, 0.16) !important;
  border-radius: 0 !important;
  background: rgba(11, 18, 51, 0.58) !important;
}

.admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table .aaa-category-preview-line:nth-child(odd) {
  background: rgba(18, 30, 72, 0.58) !important;
}

.admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table .aaa-category-preview-line:last-child {
  border-bottom: 0 !important;
}

.admin-aaa-body .aaa-category-preview-line .aaa-preview-row-num {
  width: 17px !important;
  height: 17px !important;
  font-size: 9px !important;
  background: rgba(238, 244, 255, 0.12) !important;
}

.admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table .aaa-category-preview-line p {
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  color: rgba(248, 251, 255, 0.82) !important;
}

.admin-aaa-body .aaa-preview-status,
.admin-aaa-body .aaa-preview-updated {
  min-width: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  font-size: 10px !important;
  line-height: 1 !important;
  font-weight: 700 !important;
  color: rgba(220, 229, 255, 0.66) !important;
}

.admin-aaa-body .aaa-preview-status::before {
  content: '';
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 999px;
  vertical-align: 1px;
  background: rgba(255, 112, 112, 0.9);
}

.admin-aaa-body .aaa-preview-status.active::before {
  background: #21e6a1;
}

@media (max-width: 900px) {
  .admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-copy {
    padding-right: 34px !important;
  }

  .admin-aaa-body .aaa-category-mini-table-head {
    grid-template-columns: minmax(0, 1fr) 62px !important;
    padding-left: 38px !important;
  }

  .admin-aaa-body .aaa-category-mini-table-head span:last-child,
  .admin-aaa-body .aaa-preview-updated {
    display: none !important;
  }

  .admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table .aaa-category-preview-line {
    grid-template-columns: 20px minmax(0, 1fr) 62px !important;
  }
}

/* =========================================================
   CARD MINI-TABLE REFINEMENT — NO HEADERS, DOT STATUS, SHORT DATES, SCROLL FADE
   ========================================================= */
.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-copy {
  padding-right: 48px !important;
}

.admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table {
  width: calc(100% + 16px) !important;
  margin-right: -16px !important;
  max-height: 132px !important;
  overflow-y: auto !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  -webkit-mask-size: 100% 100% !important;
  mask-size: 100% 100% !important;
}

.admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table.can-scroll-down {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 26px), transparent 100%) !important;
  mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 26px), transparent 100%) !important;
}

.admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table.can-scroll-up {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22px, #000 100%) !important;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 22px, #000 100%) !important;
}

.admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table.can-scroll-up.can-scroll-down {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22px, #000 calc(100% - 26px), transparent 100%) !important;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 22px, #000 calc(100% - 26px), transparent 100%) !important;
}

.admin-aaa-body .aaa-category-mini-table-head {
  display: none !important;
}

.admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table .aaa-category-preview-line {
  grid-template-columns: 20px minmax(0, 1fr) 24px 72px !important;
  gap: 8px !important;
  padding: 0 8px 0 10px !important;
}

.admin-aaa-body .aaa-preview-status {
  width: 24px !important;
  min-width: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  font-size: 0 !important;
  color: transparent !important;
}

.admin-aaa-body .aaa-preview-status::before {
  width: 7px !important;
  height: 7px !important;
  margin-right: 0 !important;
  vertical-align: 0 !important;
  box-shadow: 0 0 8px rgba(255, 112, 112, 0.45) !important;
}

.admin-aaa-body .aaa-preview-status.active::before {
  box-shadow: 0 0 8px rgba(33, 230, 161, 0.5) !important;
}

.admin-aaa-body .aaa-preview-updated {
  width: 72px !important;
  min-width: 72px !important;
  overflow: visible !important;
  text-overflow: clip !important;
  text-align: left !important;
  font-variant-numeric: tabular-nums !important;
}

@media (max-width: 900px) {
  .admin-aaa-body .aaa-category-card-grid-item .aaa-category-card-copy {
    padding-right: 34px !important;
  }

  .admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table {
    width: 100% !important;
    margin-right: 0 !important;
  }

  .admin-aaa-body .aaa-category-card-preview.aaa-category-mini-table .aaa-category-preview-line {
    grid-template-columns: 20px minmax(0, 1fr) 24px 72px !important;
  }

  .admin-aaa-body .aaa-preview-updated {
    display: block !important;
  }
}

/* Company customization */
.aaa-avatar-button {
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.aaa-avatar-button:hover,
.aaa-avatar-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(49, 167, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(49, 167, 255, 0.12), 0 0 28px rgba(124, 53, 255, 0.28);
  outline: none;
}

.aaa-logo-link.aaa-custom-logo-active,
.sidebar-logo-link.aaa-custom-logo-active {
  gap: 6px;
  min-height: 112px;
  padding: 10px 6px;
}

.aaa-logo-link.aaa-custom-logo-active .aaa-company-logo-img,
.sidebar-logo-link.aaa-custom-logo-active .aaa-company-logo-img {
  width: 70px;
  height: 52px;
  max-width: 82px;
  object-fit: contain;
  border-radius: 14px;
  padding: 6px;
  background: rgba(255,255,255,0.08);
  filter: none;
}

.aaa-logo-link.aaa-custom-logo-active .aaa-sidebar-logo-text,
.sidebar-logo-link.aaa-custom-logo-active .aaa-sidebar-logo-text {
  max-width: 94px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.aaa-powered-by-instint {
  display: block;
  margin-top: -2px;
  color: rgba(222, 232, 255, 0.68);
  font-size: 10px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
}

.aaa-customize-page {
  max-width: 1480px;
}

.aaa-customize-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.aaa-customize-panel {
  position: relative;
  border: 1px solid rgba(160, 178, 255, 0.24);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(16, 24, 65, 0.78), rgba(8, 12, 38, 0.72));
  box-shadow: 0 22px 70px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 26px;
  color: #fff;
  overflow: hidden;
}

.aaa-customize-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(35, 132, 255, .18), transparent 32%),
    radial-gradient(circle at 90% 8%, rgba(183, 55, 255, .16), transparent 34%);
  pointer-events: none;
}

.aaa-customize-panel > * { position: relative; z-index: 1; }

.aaa-panel-heading { margin-bottom: 20px; }
.aaa-section-eyebrow {
  display: inline-flex;
  color: #82c9ff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.aaa-panel-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.aaa-panel-heading p {
  margin: 8px 0 0;
  color: rgba(232, 239, 255, 0.76);
  line-height: 1.55;
}

.aaa-logo-upload-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  align-items: center;
}

.aaa-logo-preview-box {
  min-height: 150px;
  border-radius: 22px;
  border: 1px dashed rgba(181, 200, 255, 0.32);
  background: rgba(255,255,255,0.055);
  display: grid;
  place-items: center;
  padding: 18px;
}

.aaa-logo-preview-box img {
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
}

.aaa-logo-empty-state {
  color: rgba(233, 240, 255, 0.62);
  text-align: center;
  font-weight: 600;
}

.aaa-logo-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.aaa-logo-upload-actions input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.aaa-file-label { display: inline-flex; align-items: center; cursor: pointer; }

.aaa-customize-form-grid,
.aaa-branch-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.aaa-customize-form-grid label,
.aaa-branch-editor-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(238, 245, 255, 0.84);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.aaa-customize-form-grid input,
.aaa-customize-form-grid textarea,
.aaa-branch-editor-grid input,
.aaa-branch-editor-grid textarea {
  width: 100%;
  border: 1px solid rgba(169, 188, 255, 0.24);
  border-radius: 15px;
  background: rgba(5, 9, 31, 0.50);
  color: #fff;
  outline: none;
  padding: 14px 15px;
  font-size: 15px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.aaa-customize-form-grid textarea,
.aaa-branch-editor-grid textarea { resize: vertical; min-height: 88px; }
.aaa-full-field { grid-column: 1 / -1; }

.aaa-customize-form-grid input:focus,
.aaa-customize-form-grid textarea:focus,
.aaa-branch-editor-grid input:focus,
.aaa-branch-editor-grid textarea:focus {
  border-color: rgba(49, 167, 255, 0.86);
  box-shadow: 0 0 0 4px rgba(49, 167, 255, 0.12), inset 0 1px 0 rgba(255,255,255,0.05);
}

.aaa-customize-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.aaa-customize-status {
  color: rgba(218, 232, 255, 0.82);
  font-weight: 600;
}

.aaa-branches-panel { margin-top: 0; }
.aaa-branch-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.aaa-branch-card,
.aaa-empty-branch-card {
  border: 1px solid rgba(169, 188, 255, 0.20);
  border-radius: 18px;
  background: rgba(255,255,255,0.07);
  padding: 18px;
}

.aaa-empty-branch-card {
  color: rgba(235, 243, 255, 0.68);
  font-weight: 600;
}

.aaa-branch-card strong {
  display: block;
  color: #fff;
  font-size: 18px;
  margin-bottom: 5px;
}

.aaa-branch-card span {
  display: block;
  color: rgba(232, 240, 255, 0.72);
  line-height: 1.45;
}

.aaa-branch-card dl {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
}

.aaa-branch-card dl div {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
}

.aaa-branch-card dt {
  color: rgba(130, 201, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.aaa-branch-card dd {
  margin: 0;
  color: rgba(247, 250, 255, 0.88);
  font-weight: 600;
  word-break: break-word;
}

.aaa-branch-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.aaa-danger-btn {
  border-color: rgba(255, 105, 123, 0.38) !important;
  color: #ffd8dc !important;
}

@media (max-width: 980px) {
  .aaa-customize-grid,
  .aaa-logo-upload-row,
  .aaa-customize-form-grid,
  .aaa-branch-editor-grid {
    grid-template-columns: 1fr;
  }

  .aaa-logo-preview-box { min-height: 130px; }
}

/* Company logo editor controls */
.aaa-logo-editor-panel {
  margin-top: 22px;
  border: 1px solid rgba(130, 201, 255, 0.20);
  border-radius: 20px;
  background: rgba(3, 8, 30, 0.36);
  padding: 18px;
}

.aaa-logo-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.aaa-logo-editor-head h3 {
  margin: 0;
  color: #fff;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.aaa-logo-canvas-wrap {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(169, 188, 255, 0.22);
  background:
    linear-gradient(45deg, rgba(255,255,255,0.07) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.07) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.07) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.07) 75%),
    rgba(5, 9, 31, 0.42);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  overflow: hidden;
  padding: 10px;
}

.aaa-logo-canvas-wrap canvas {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
}

.aaa-logo-crop-note {
  margin-top: 8px;
  color: rgba(232, 240, 255, 0.62);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.aaa-logo-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.aaa-logo-controls-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(238, 245, 255, 0.84);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.aaa-logo-controls-grid input[type="range"] {
  width: 100%;
  accent-color: #31a7ff;
}

.aaa-logo-controls-grid input[type="color"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(169, 188, 255, 0.24);
  border-radius: 14px;
  background: rgba(5, 9, 31, 0.50);
  padding: 5px;
}

.aaa-checkbox-control {
  min-height: 42px;
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  border: 1px solid rgba(169, 188, 255, 0.18);
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  padding: 10px 12px;
}

.aaa-checkbox-control input {
  width: 18px;
  height: 18px;
  accent-color: #31a7ff;
}

.aaa-logo-help-text {
  color: rgba(218, 232, 255, 0.70);
  font-weight: 600;
  font-size: 13px;
}

@media (max-width: 980px) {
  .aaa-logo-editor-head,
  .aaa-logo-controls-grid {
    grid-template-columns: 1fr;
  }

  .aaa-logo-editor-head { flex-direction: column; }
}

.aaa-logo-editor-toggle {
  background: linear-gradient(135deg, #31a7ff, #2f6dff) !important;
  border-color: rgba(49, 167, 255, 0.75) !important;
  color: #fff !important;
  box-shadow: 0 12px 30px rgba(49, 167, 255, 0.22) !important;
}

.aaa-logo-display-name-field {
  margin-top: 18px;
  border: 1px solid rgba(169, 188, 255, 0.20);
  border-radius: 18px;
  background: rgba(255,255,255,0.055);
  padding: 16px;
}

.aaa-logo-display-name-field label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(238, 245, 255, 0.84);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.aaa-logo-display-name-field input {
  width: 100%;
  border: 1px solid rgba(169, 188, 255, 0.24);
  border-radius: 15px;
  background: rgba(5, 9, 31, 0.50);
  color: #fff;
  outline: none;
  padding: 14px 15px;
  font-size: 15px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.aaa-logo-display-name-field input:focus {
  border-color: rgba(49, 167, 255, 0.86);
  box-shadow: 0 0 0 4px rgba(49, 167, 255, 0.12), inset 0 1px 0 rgba(255,255,255,0.05);
}

.aaa-logo-display-name-field p {
  margin: 9px 0 0;
  color: rgba(232, 240, 255, 0.66);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
}


/* Company Customization branch editor collapse controls */
.aaa-branch-add-row {
  margin-top: 18px;
}

.aaa-branch-editor-wrap {
  margin-top: 18px;
  border: 1px solid rgba(169, 188, 255, 0.18);
  border-radius: 20px;
  background: rgba(5, 9, 31, 0.24);
  padding: 18px;
}


/* Duplicate review persistence controls */
.aaa-duplicate-header-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.aaa-duplicate-toggle-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(232, 240, 255, 0.82);
  font-weight: 600;
  font-size: 13px;
}

.aaa-previously-not-duplicate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(130, 201, 255, 0.22);
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
}

.aaa-previously-not-duplicate-toolbar label,
.aaa-previously-not-duplicate-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(245, 249, 255, 0.9);
  font-weight: 700;
  font-size: 13px;
}

.aaa-duplicate-review-card.is-previously-not-duplicate {
  border-color: rgba(130, 201, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(130, 201, 255, 0.08), 0 18px 46px rgba(0,0,0,0.22);
}


/* Duplicate scan settings */
.aaa-duplicate-settings-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-top: 10px;
}

.aaa-duplicate-setting {
  display: grid;
  gap: 7px;
  min-width: 230px;
  color: rgba(232, 240, 255, 0.9);
  font-weight: 600;
  font-size: 13px;
}

.aaa-duplicate-setting span {
  color: rgba(232, 240, 255, 0.78);
  letter-spacing: 0.02em;
}

.aaa-duplicate-setting select {
  appearance: none;
  min-height: 42px;
  border: 1px solid rgba(130, 201, 255, 0.28);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(10, 21, 65, 0.95), rgba(24, 29, 92, 0.95));
  color: #ffffff;
  font-weight: 600;
  padding: 10px 42px 10px 13px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.aaa-duplicate-setting select:focus {
  border-color: rgba(92, 168, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.aaa-duplicate-setting select option {
  background: #0b153f;
  color: #ffffff;
}


/* Smart merge full-panel loading state */
.aaa-merge-preview {
  position: relative;
}

.aaa-smart-merge-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background:
    radial-gradient(circle at 35% 25%, rgba(78, 120, 255, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(6, 14, 48, 0.96), rgba(20, 25, 80, 0.96));
  backdrop-filter: blur(3px);
}

.aaa-smart-merge-loading[hidden] {
  display: none;
}

.aaa-smart-merge-loading-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: #ffffff;
  padding: 24px;
}

.aaa-smart-merge-loading-card strong {
  font-size: 20px;
  font-weight: 700;
}

.aaa-smart-merge-loading-card span {
  max-width: 420px;
  color: rgba(232, 240, 255, 0.78);
  font-weight: 700;
}

.aaa-chasing-dots {
  position: relative;
  width: 72px;
  height: 22px;
  margin-top: 4px;
}

.aaa-chasing-dots i {
  position: absolute;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ffffff;
  opacity: 0.35;
  animation: aaaChasingDots 1.05s infinite ease-in-out;
}

.aaa-chasing-dots i:nth-child(1) {
  left: 8px;
  animation-delay: 0s;
}

.aaa-chasing-dots i:nth-child(2) {
  left: 26px;
  animation-delay: 0.14s;
}

.aaa-chasing-dots i:nth-child(3) {
  left: 44px;
  animation-delay: 0.28s;
}

.aaa-chasing-dots i:nth-child(4) {
  left: 62px;
  animation-delay: 0.42s;
}

@keyframes aaaChasingDots {
  0%, 80%, 100% {
    transform: translateY(0) scale(0.82);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-7px) scale(1);
    opacity: 1;
  }
}


/* Preserve imported/manual knowledge formatting in card previews */
.formatted-knowledge-content,
.knowledge-card .card-content.formatted-knowledge-content {
  display: block;
  white-space: normal;
  line-height: 1.55;
}

.formatted-content-line {
  display: block;
  min-height: 1.45em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.formatted-content-bullet {
  padding-left: 1.1em;
  text-indent: -0.8em;
}

.formatted-content-spacer {
  min-height: 0.7em;
}


/* Knowledge card source/link contrast */
.knowledge-card .formatted-knowledge-content a,
.knowledge-card .card-content a {
  color: #ffd166;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.knowledge-card .formatted-knowledge-content a:hover,
.knowledge-card .card-content a:hover {
  color: #fff3b0;
}

.founder-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.founder-form-wide {
  grid-column: 1 / -1;
}

.founder-form-subhead {
  margin: 22px 0 8px;
  font-size: 1rem;
  color: #1f2937;
}

.founder-client-form input,
.founder-client-form select,
.founder-client-form textarea {
  width: 100%;
}

.founder-created-meta {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.founder-created-meta code {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

@media (max-width: 900px) {
  .founder-form-grid {
    grid-template-columns: 1fr;
  }
}


/* Founder page cleanup: keep sections collapsed until opened */
.admin-aaa-body .founder-collapsible-section {
  overflow: hidden;
}

.admin-aaa-body .founder-collapsible-section > .analytics-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
}

.admin-aaa-body .founder-collapsible-section > .analytics-panel-header:focus-visible {
  outline: 3px solid rgba(62, 168, 255, 0.55);
  outline-offset: 4px;
  border-radius: 14px;
}

.admin-aaa-body .founder-collapsible-section > .analytics-panel-header h2 {
  margin-bottom: 4px;
}

.admin-aaa-body .founder-collapse-indicator {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(223, 232, 255, 0.36);
  background: rgba(238, 244, 255, 0.12);
  color: rgba(248, 251, 255, 0.92);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.admin-aaa-body .founder-collapsible-section.is-collapsed > :not(.analytics-panel-header) {
  display: none !important;
}

.admin-aaa-body .founder-collapsible-section:not(.is-collapsed) > .analytics-panel-header {
  margin-bottom: 18px;
}

/* Founder dropdown contrast fixes */
.admin-aaa-body select,
.admin-aaa-body .support-form select,
.admin-aaa-body .founder-client-form select {
  color: rgba(248, 251, 255, 0.94);
  -webkit-text-fill-color: rgba(248, 251, 255, 0.94);
  background-color: rgba(11, 17, 51, 0.72);
}

.admin-aaa-body select:disabled,
.admin-aaa-body select option[value=""] {
  color: rgba(248, 251, 255, 0.68);
}

.admin-aaa-body select option,
.admin-aaa-body select optgroup {
  color: rgba(248, 251, 255, 0.94);
  background-color: #171d3f;
}

.admin-aaa-body select option:checked,
.admin-aaa-body select option:hover {
  color: #ffffff;
  background-color: #505066;
}

.admin-aaa-body select:focus {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

.founder-toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  color: rgba(245, 248, 255, 0.86);
  font-weight: 700;
}

.founder-toggle-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #7c4dff;
}

.founder-account-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.founder-account-actions .secondary-btn,
.founder-account-actions .danger-outline-btn {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 13px;
}

.founder-mfa-setup-panel {
  margin: -8px 0 14px 24px;
  max-width: 720px;
}

.founder-mfa-setup-panel p {
  color: rgba(227, 233, 255, 0.78);
  margin: 8px 0 14px;
}

.founder-mfa-setup-panel input {
  margin-bottom: 12px;
}

/* =========================================================
   InstInt Light UI refresh – matches the simplified white UI mockup
   ========================================================= */
body.admin-aaa-body {
  --aaa-bg: #fbfcff;
  --aaa-bg-2: #f6f8fc;
  --aaa-ink: #24283a;
  --aaa-ink-soft: #444b63;
  --aaa-muted: #697089;
  --aaa-line: #e2e6ef;
  --aaa-line-strong: #d4dae7;
  --aaa-blue: #4f7df3;
  --aaa-cyan: #5aa7f7;
  --aaa-violet: #6a4df5;
  --aaa-magenta: #8d6bf7;
  --aaa-green: #4f7df3;
  --aaa-danger: #b94a5d;
  --aaa-panel: #ffffff;
  --aaa-frost: #ffffff;
  --aaa-frost-light: #f8faff;
  --aaa-shadow-sm: 0 1px 2px rgba(19, 28, 54, 0.04);
  --aaa-shadow-md: 0 14px 40px rgba(31, 42, 74, 0.06);
  --aaa-shadow-lg: 0 24px 70px rgba(31, 42, 74, 0.10);
}

html,
body.admin-aaa-body {
  color-scheme: light;
}

body.admin-aaa-body {
  min-height: 100vh;
  color: var(--aaa-ink) !important;
  background:
    radial-gradient(circle at 88% 10%, rgba(106, 77, 245, 0.08), transparent 24%),
    radial-gradient(circle at 18% 85%, rgba(79, 125, 243, 0.06), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 44%, #f7f9fd 100%) !important;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

body.admin-aaa-body::before,
body.admin-aaa-body::after {
  display: none !important;
}

.admin-aaa-shell {
  background: transparent !important;
}

/* Sidebar */
.admin-aaa-body .aaa-sidebar {
  width: 140px !important;
  min-width: 140px !important;
  padding: 16px 11px 18px !important;
  gap: 13px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border-right: 1px solid var(--aaa-line) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.admin-aaa-body .aaa-logo-link,
.admin-aaa-body .sidebar-logo-link.aaa-logo-link {
  height: 86px !important;
  padding: 0 0 15px !important;
  border-bottom: 1px solid var(--aaa-line) !important;
  gap: 6px !important;
  text-decoration: none !important;
  background: transparent !important;
}

.admin-aaa-body .aaa-logo-link .aaa-lightning-logo,
.admin-aaa-body .aaa-lightning-logo {
  width: 42px !important;
  height: 54px !important;
  object-fit: contain;
  filter: drop-shadow(0 7px 14px rgba(106, 77, 245, 0.16)) !important;
}

.admin-aaa-body .aaa-sidebar-logo-text {
  color: #2f3548 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  text-shadow: none !important;
}

.admin-aaa-body .aaa-sidebar-nav {
  gap: 7px !important;
  margin-top: 0 !important;
}

.admin-aaa-body .aaa-nav-link,
.admin-aaa-body .sidebar-bottom-link.aaa-nav-link {
  min-height: 68px !important;
  border-radius: 12px !important;
  gap: 6px !important;
  color: #4b5369 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  background: transparent !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-nav-link svg {
  width: 24px !important;
  height: 24px !important;
  stroke-width: 1.9 !important;
  filter: none !important;
}

.admin-aaa-body .aaa-nav-link:hover {
  transform: none !important;
  color: #5d43e6 !important;
  background: #f5f1ff !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-nav-link.active {
  color: #6047e8 !important;
  background: #f1ecff !important;
  box-shadow: inset 0 0 0 1px rgba(106, 77, 245, 0.04) !important;
}

.admin-aaa-body .aaa-nav-link.active::before {
  display: none !important;
}

.admin-aaa-body .aaa-admin-link,
.admin-aaa-body .sidebar-bottom-link.aaa-admin-link {
  margin-top: auto !important;
  min-height: 48px !important;
  padding-top: 0 !important;
  border-top: 0 !important;
  border-radius: 12px !important;
}

/* Top bar */
.admin-aaa-body .aaa-main-shell,
.admin-aaa-body .main-shell.aaa-main-shell {
  min-width: 0;
  flex: 1;
  background: transparent !important;
}

.admin-aaa-body .aaa-topbar,
.admin-aaa-body .topbar.aaa-topbar {
  height: 76px !important;
  padding: 0 34px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid var(--aaa-line) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.admin-aaa-body .aaa-topbar-title,
.admin-aaa-body .topbar-title.aaa-topbar-title {
  color: #383e51 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  letter-spacing: -0.018em !important;
  text-shadow: none !important;
}

.admin-aaa-body .aaa-topbar-actions {
  gap: 15px !important;
}

.admin-aaa-body .aaa-icon-top,
.admin-aaa-body .aaa-avatar,
.admin-aaa-body .aaa-avatar-button {
  border: 1px solid var(--aaa-line) !important;
  background: #ffffff !important;
  color: #262b3c !important;
  box-shadow: var(--aaa-shadow-sm) !important;
}

.admin-aaa-body .aaa-icon-top {
  width: 48px !important;
  height: 48px !important;
  border-radius: 999px !important;
}

.admin-aaa-body .aaa-icon-top svg {
  width: 21px !important;
  height: 21px !important;
  stroke: currentColor !important;
}

.admin-aaa-body .aaa-avatar,
.admin-aaa-body .aaa-avatar-button {
  width: 54px !important;
  height: 54px !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-avatar span,
.admin-aaa-body .aaa-avatar-button span {
  right: 4px !important;
  bottom: 4px !important;
  width: 12px !important;
  height: 12px !important;
  border: 2px solid #ffffff !important;
  background: #35c27c !important;
}

/* Global buttons */
.admin-aaa-body .primary-btn,
.admin-aaa-body button.primary-btn,
.admin-aaa-body .aaa-top-add,
.admin-aaa-body .aaa-file-label {
  border: 0 !important;
  color: #ffffff !important;
  background: linear-gradient(180deg, #7357ee 0%, #6245dc 100%) !important;
  box-shadow: 0 10px 22px rgba(98, 69, 220, 0.20) !important;
  font-weight: 600 !important;
}

.admin-aaa-body .primary-btn:hover,
.admin-aaa-body .aaa-top-add:hover,
.admin-aaa-body .aaa-file-label:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #6c50e8 0%, #593fd0 100%) !important;
  box-shadow: 0 14px 28px rgba(98, 69, 220, 0.24) !important;
}

.admin-aaa-body .aaa-top-add {
  min-width: 138px !important;
  height: 46px !important;
  padding: 0 24px !important;
  border-radius: 11px !important;
  font-size: 14px !important;
}

.admin-aaa-body .secondary-btn,
.admin-aaa-body button.secondary-btn,
.admin-aaa-body .card-btn,
.admin-aaa-body .icon-btn,
.admin-aaa-body .aaa-manage-btn,
.admin-aaa-body .aaa-duplicate-check-btn {
  color: #2e3446 !important;
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: var(--aaa-shadow-sm) !important;
  font-weight: 600 !important;
}

.admin-aaa-body .secondary-btn:hover,
.admin-aaa-body .card-btn:hover,
.admin-aaa-body .icon-btn:hover,
.admin-aaa-body .aaa-manage-btn:hover,
.admin-aaa-body .aaa-duplicate-check-btn:hover {
  background: #f8f9fd !important;
  border-color: var(--aaa-line-strong) !important;
  color: #252a3b !important;
  transform: none !important;
}

.admin-aaa-body .danger-outline-btn,
.admin-aaa-body .delete-btn,
.admin-aaa-body .aaa-editor-delete-btn {
  color: #b94a5d !important;
  background: #fff7f8 !important;
  border: 1px solid #f0ccd2 !important;
  box-shadow: none !important;
}

/* Main content */
.admin-aaa-body .aaa-content-shell,
.admin-aaa-body .content-shell.aaa-content-shell {
  background: transparent !important;
}

.admin-aaa-body .aaa-content-area,
.admin-aaa-body .content-area.aaa-content-area {
  width: 100% !important;
  padding: 38px 54px 58px !important;
  color: var(--aaa-ink) !important;
}

.admin-aaa-body .aaa-content-header,
.admin-aaa-body .content-header.aaa-content-header {
  margin: 0 0 26px !important;
  align-items: flex-start !important;
}

.admin-aaa-body .aaa-content-header h1,
.admin-aaa-body .content-header.aaa-content-header h1 {
  position: relative;
  margin: 0 !important;
  padding-left: 26px !important;
  color: #222638 !important;
  font-size: clamp(32px, 2.35vw, 42px) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.052em !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

.admin-aaa-body .aaa-content-header h1::before,
.admin-aaa-body .content-header.aaa-content-header h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 6px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7f5df2, #5d78f7);
  box-shadow: 0 6px 16px rgba(106, 77, 245, 0.18);
}

.admin-aaa-body .aaa-content-header p,
.admin-aaa-body .content-header.aaa-content-header p {
  margin: 8px 0 0 26px !important;
  color: #5c647a !important;
  font-size: 16px !important;
  line-height: 1.45 !important;
  font-weight: 500 !important;
}

/* Filters */
.admin-aaa-body .aaa-filters-row,
.admin-aaa-body .filters-row.aaa-filters-row {
  display: grid !important;
  grid-template-columns: minmax(290px, 1.5fr) minmax(220px, 1fr) minmax(220px, 1fr) !important;
  gap: 20px !important;
  margin: 0 0 24px !important;
}

.admin-aaa-body .aaa-control-wrap,
.admin-aaa-body .search-wrap.aaa-control-wrap,
.admin-aaa-body .filter-wrap.aaa-control-wrap {
  height: 54px !important;
  border: 1px solid var(--aaa-line) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: var(--aaa-shadow-sm) !important;
  display: flex !important;
  align-items: center !important;
  overflow: hidden !important;
}

.admin-aaa-body .aaa-control-wrap::before {
  display: none !important;
}

.admin-aaa-body .aaa-control-wrap::after {
  color: #697089 !important;
  right: 16px !important;
  font-size: 18px !important;
}

.admin-aaa-body .aaa-control-icon {
  left: 18px !important;
  width: 20px !important;
  height: 20px !important;
  color: #657087 !important;
  stroke: currentColor !important;
  opacity: 1 !important;
}

.admin-aaa-body .aaa-control-wrap input,
.admin-aaa-body .aaa-control-wrap select,
.admin-aaa-body .search-wrap.aaa-control-wrap input,
.admin-aaa-body .filter-wrap.aaa-control-wrap select {
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 48px !important;
  border: 0 !important;
  border-radius: 12px !important;
  color: #303648 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  outline: none !important;
  color-scheme: light !important;
}

.admin-aaa-body .aaa-control-wrap input::placeholder {
  color: #8990a3 !important;
}

.admin-aaa-body .aaa-control-wrap:focus-within {
  border-color: rgba(106, 77, 245, 0.48) !important;
  box-shadow: 0 0 0 4px rgba(106, 77, 245, 0.08) !important;
}

.admin-aaa-body .aaa-shortcut {
  right: 12px !important;
  height: 30px !important;
  padding: 0 11px !important;
  border-radius: 8px !important;
  color: #6e7487 !important;
  background: #f8f9fc !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

/* View toolbar */
.admin-aaa-body .aaa-view-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  margin: 4px 0 18px !important;
}

.admin-aaa-body .aaa-view-summary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  color: #111827 !important;
  font-size: 17px !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-view-summary strong {
  color: #151927 !important;
}

.admin-aaa-body .aaa-view-count {
  min-width: 40px !important;
  height: 32px !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: #6047e8 !important;
  background: #f1ecff !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-view-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px !important;
  border: 1px solid var(--aaa-line) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: var(--aaa-shadow-sm) !important;
}

.admin-aaa-body .aaa-view-btn {
  min-width: 94px !important;
  width: auto !important;
  height: 42px !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: #586177 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  cursor: pointer !important;
}

.admin-aaa-body .aaa-view-btn svg {
  width: 20px !important;
  height: 20px !important;
  stroke-width: 2.1 !important;
}

.admin-aaa-body .aaa-view-btn span {
  color: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-view-btn.active {
  color: #6047e8 !important;
  background: #f4f0ff !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-duplicate-check-btn {
  height: 42px !important;
  min-width: 154px !important;
  padding: 0 18px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
}

/* Topic associations */
.admin-aaa-body .aaa-association-manager,
.admin-aaa-body .association-manager.aaa-association-manager,
.admin-aaa-body .aaa-customize-panel,
.admin-aaa-body .billing-card,
.admin-aaa-body .support-card,
.admin-aaa-body .founder-card,
.admin-aaa-body .saas-card,
.admin-aaa-body .import-card,
.admin-aaa-body .recycle-card,
.admin-aaa-body .feedback-card,
.admin-aaa-body .role-panel,
.admin-aaa-body .security-panel,
.admin-aaa-body .history-panel,
.admin-aaa-body .inquiry-panel {
  color: var(--aaa-ink) !important;
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-association-manager,
.admin-aaa-body .association-manager.aaa-association-manager {
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 18px !important;
  min-height: 158px !important;
  margin: 0 0 20px !important;
  padding: 24px 22px !important;
  overflow: visible !important;
}

.admin-aaa-body .aaa-association-manager::before {
  display: none !important;
}

.admin-aaa-body .aaa-section-icon,
.admin-aaa-body .aaa-association-manager .aaa-section-icon {
  width: 46px !important;
  height: 46px !important;
  border-radius: 12px !important;
  color: #6047e8 !important;
  background: #f1ecff !important;
  border: 0 !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-section-icon svg,
.admin-aaa-body .aaa-association-manager .aaa-section-icon svg {
  width: 24px !important;
  height: 24px !important;
  stroke: currentColor !important;
}

.admin-aaa-body .aaa-section-copy h2,
.admin-aaa-body .aaa-association-manager h2,
.admin-aaa-body .association-manager.aaa-association-manager h2 {
  color: #222638 !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

.admin-aaa-body .aaa-section-copy p,
.admin-aaa-body .aaa-association-manager p,
.admin-aaa-body .association-manager.aaa-association-manager p {
  color: #616a82 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-association-list,
.admin-aaa-body .association-list.aaa-association-list,
.admin-aaa-body .association-list {
  min-height: 78px !important;
  margin-top: 16px !important;
  padding: 0 18px !important;
  color: #646c80 !important;
  background: #fbfcff !important;
  border: 1px dashed #cfd6e4 !important;
  border-radius: 12px !important;
  display: grid !important;
  place-items: center !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-manage-btn {
  align-self: center !important;
  min-width: 112px !important;
  height: 46px !important;
  border-radius: 11px !important;
  padding: 0 18px !important;
}

/* Table view */
.admin-aaa-body .aaa-knowledge-table-view,
.admin-aaa-body .knowledge-grid.aaa-knowledge-table-view {
  display: block !important;
}

.admin-aaa-body .aaa-knowledge-table-shell {
  width: 100% !important;
  overflow: hidden !important;
  border: 1px solid var(--aaa-line) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-knowledge-table-header,
.admin-aaa-body .aaa-table-entry-row {
  display: grid !important;
  grid-template-columns: 210px minmax(190px, 0.9fr) minmax(300px, 1.9fr) 116px 128px 82px !important;
  align-items: center !important;
}

.admin-aaa-body .aaa-knowledge-table-header {
  min-height: 40px !important;
  padding: 0 20px !important;
  color: #4f586e !important;
  background: #ffffff !important;
  border-bottom: 1px solid var(--aaa-line) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.045em !important;
}

.admin-aaa-body .aaa-table-category-row {
  min-height: 42px !important;
  padding: 0 20px !important;
  color: #2f3548 !important;
  background: #ffffff !important;
  border-bottom: 1px solid var(--aaa-line) !important;
  display: grid !important;
  grid-template-columns: 210px minmax(0, 1fr) auto !important;
}

.admin-aaa-body .aaa-table-category-group:nth-of-type(even) .aaa-table-category-row {
  background: #fbfcff !important;
}

.admin-aaa-body .aaa-table-category-group.expanded .aaa-table-category-row {
  background: #f8f9fc !important;
}

.admin-aaa-body .aaa-table-category-name,
.admin-aaa-body .aaa-table-category-name strong {
  color: #303648 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-table-category-meta {
  color: #7a8398 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-table-chevron {
  color: #526078 !important;
  stroke: currentColor !important;
}

.admin-aaa-body .aaa-table-entry-row {
  min-height: 58px !important;
  padding: 0 20px !important;
  color: #3f4659 !important;
  border-bottom: 1px solid var(--aaa-line) !important;
  background: #ffffff !important;
  font-size: 13px !important;
}

.admin-aaa-body .aaa-table-entry-row:nth-child(odd),
.admin-aaa-body .aaa-table-entry-row:nth-child(even) {
  background: #ffffff !important;
}

.admin-aaa-body .aaa-table-entry-row:hover {
  background: #fbfcff !important;
}

.admin-aaa-body .aaa-table-category-group:last-child .aaa-table-entry-row:last-child {
  border-bottom: 0 !important;
}

.admin-aaa-body .aaa-table-entry-category,
.admin-aaa-body .aaa-table-entry-updated {
  color: #667085 !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-table-entry-title {
  color: #24283a !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-table-entry-preview {
  color: #4f586e !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-table-entry-status {
  color: #3f4659 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-table-entry-status span,
.admin-aaa-body .status-active::before,
.admin-aaa-body .aaa-status-dot.active {
  background: #4f7df3 !important;
  box-shadow: 0 0 0 3px rgba(79, 125, 243, 0.11) !important;
}

.admin-aaa-body .aaa-table-entry-status.inactive span,
.admin-aaa-body .status-inactive::before {
  background: #a8afbf !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-table-entry-actions {
  gap: 8px !important;
  justify-content: flex-end !important;
}

.admin-aaa-body .aaa-table-action-btn {
  min-width: 54px !important;
  height: 34px !important;
  padding: 0 12px !important;
  border: 1px solid var(--aaa-line) !important;
  border-radius: 8px !important;
  color: #303648 !important;
  background: #ffffff !important;
  box-shadow: var(--aaa-shadow-sm) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-table-action-btn:hover {
  background: #f8f9fd !important;
}

/* Card view and generic knowledge cards */
.admin-aaa-body .knowledge-grid.aaa-knowledge-grid,
.admin-aaa-body .aaa-knowledge-grid {
  gap: 18px !important;
}

.admin-aaa-body .knowledge-card,
.admin-aaa-body .aaa-category-card,
.admin-aaa-body .aaa-category-card-grid-item,
.admin-aaa-body .aaa-duplicate-review-card,
.admin-aaa-body .aaa-duplicate-summary-card,
.admin-aaa-body .aaa-duplicate-bucket,
.admin-aaa-body .aaa-duplicate-workspace,
.admin-aaa-body .aaa-duplicate-left-panel,
.admin-aaa-body .aaa-duplicate-analysis-panel,
.admin-aaa-body .duplicate-column,
.admin-aaa-body .aaa-merge-source-card {
  color: var(--aaa-ink) !important;
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: none !important;
}

.admin-aaa-body .knowledge-card:hover,
.admin-aaa-body .aaa-category-card:hover,
.admin-aaa-body .aaa-category-card-grid-item:hover {
  transform: translateY(-1px) !important;
  box-shadow: var(--aaa-shadow-md) !important;
}

.admin-aaa-body .category-badge,
.admin-aaa-body .status-badge,
.admin-aaa-body .topic-label,
.admin-aaa-body .aaa-duplicate-type,
.admin-aaa-body .aaa-duplicate-review-score,
.admin-aaa-body .aaa-section-eyebrow {
  color: #6047e8 !important;
  background: #f4f0ff !important;
  border-color: #e2d9ff !important;
  box-shadow: none !important;
}

.admin-aaa-body .status-badge.status-active,
.admin-aaa-body .aaa-table-entry-status.active {
  color: #3f4659 !important;
}

.admin-aaa-body .card-title,
.admin-aaa-body .knowledge-card h3,
.admin-aaa-body .aaa-category-card h3,
.admin-aaa-body .duplicate-column h3,
.admin-aaa-body .aaa-duplicate-review-column h3,
.admin-aaa-body .aaa-panel-heading h2,
.admin-aaa-body .aaa-duplicate-section-heading h2 {
  color: #24283a !important;
  text-shadow: none !important;
}

.admin-aaa-body .card-content,
.admin-aaa-body .formatted-knowledge-content,
.admin-aaa-body .duplicate-content,
.admin-aaa-body .aaa-duplicate-review-column .duplicate-content,
.admin-aaa-body .aaa-panel-heading p,
.admin-aaa-body .aaa-duplicate-section-heading p,
.admin-aaa-body .aaa-customize-panel p,
.admin-aaa-body .empty-state {
  color: #5f687d !important;
}

.admin-aaa-body .card-divider {
  border-color: var(--aaa-line) !important;
}

/* Forms, drawers, overlays */
.admin-aaa-body .aaa-editor-panel,
.admin-aaa-body .knowledge-editor-panel.aaa-editor-panel {
  color: var(--aaa-ink) !important;
  background: #ffffff !important;
  border-left: 1px solid var(--aaa-line) !important;
  box-shadow: -24px 0 70px rgba(31, 42, 74, 0.12) !important;
}

.admin-aaa-body .aaa-editor-panel > .panel-header,
.admin-aaa-body .knowledge-editor-panel .panel-header {
  background: #ffffff !important;
  border-bottom: 1px solid var(--aaa-line) !important;
}

.admin-aaa-body .aaa-editor-panel h2,
.admin-aaa-body .knowledge-editor-panel h2,
.admin-aaa-body .panel-header h2 {
  color: #24283a !important;
}

.admin-aaa-body .field-label,
.admin-aaa-body label,
.admin-aaa-body .toggle-row span {
  color: #3b4358 !important;
}

.admin-aaa-body input[type="text"],
.admin-aaa-body input[type="email"],
.admin-aaa-body input[type="password"],
.admin-aaa-body input[type="number"],
.admin-aaa-body input[type="tel"],
.admin-aaa-body input[type="url"],
.admin-aaa-body textarea,
.admin-aaa-body select,
.admin-aaa-body .category-smart-select,
.admin-aaa-body .knowledge-editor-panel #title,
.admin-aaa-body .knowledge-editor-panel #categorySelect,
.admin-aaa-body .knowledge-editor-panel .category-smart-select {
  color-scheme: light !important;
  color: #252b3d !important;
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: none !important;
}

.admin-aaa-body input::placeholder,
.admin-aaa-body textarea::placeholder {
  color: #949bad !important;
}

.admin-aaa-body input:focus,
.admin-aaa-body textarea:focus,
.admin-aaa-body select:focus,
.admin-aaa-body .category-smart-select:focus {
  border-color: rgba(106, 77, 245, 0.50) !important;
  box-shadow: 0 0 0 4px rgba(106, 77, 245, 0.08) !important;
  outline: none !important;
}

.admin-aaa-body select option,
.admin-aaa-body .knowledge-editor-panel select option,
.admin-aaa-body .knowledge-editor-panel #categorySelect option {
  color: #252b3d !important;
  background: #ffffff !important;
}

.admin-aaa-body .switch .slider {
  background: #d7dce8 !important;
}

.admin-aaa-body .switch input:checked + .slider {
  background: #6a4df5 !important;
}

.admin-aaa-body .duplicate-overlay,
.admin-aaa-body .aaa-duplicate-overlay {
  background: rgba(17, 24, 39, 0.36) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.admin-aaa-body .duplicate-modal,
.admin-aaa-body .aaa-duplicate-overlay .duplicate-modal {
  color: var(--aaa-ink) !important;
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
  border-radius: 18px !important;
  box-shadow: var(--aaa-shadow-lg) !important;
}

.admin-aaa-body .duplicate-header,
.admin-aaa-body .duplicate-actions {
  background: #ffffff !important;
  border-color: var(--aaa-line) !important;
}

.admin-aaa-body .duplicate-header h2,
.admin-aaa-body .duplicate-column h3,
.admin-aaa-body .duplicate-match-btn strong {
  color: #24283a !important;
}

.admin-aaa-body .duplicate-header p,
.admin-aaa-body .duplicate-meta,
.admin-aaa-body .duplicate-match-btn span {
  color: #667085 !important;
}

.admin-aaa-body .status-message {
  color: #4f586e !important;
}

/* Keep page-specific tables and lists aligned with the light system */
.admin-aaa-body table,
.admin-aaa-body .history-table,
.admin-aaa-body .role-table,
.admin-aaa-body .billing-table,
.admin-aaa-body .audit-table,
.admin-aaa-body .data-table {
  color: var(--aaa-ink) !important;
  background: #ffffff !important;
  border-color: var(--aaa-line) !important;
}

.admin-aaa-body th,
.admin-aaa-body .table-header {
  color: #4f586e !important;
  background: #fbfcff !important;
  border-color: var(--aaa-line) !important;
}

.admin-aaa-body td,
.admin-aaa-body .table-row,
.admin-aaa-body .history-row,
.admin-aaa-body .role-row {
  color: #3f4659 !important;
  border-color: var(--aaa-line) !important;
}

/* Responsive behavior */
@media (max-width: 1180px) {
  .admin-aaa-body .aaa-content-area,
  .admin-aaa-body .content-area.aaa-content-area {
    padding: 32px 28px 48px !important;
  }

  .admin-aaa-body .aaa-knowledge-table-shell {
    overflow-x: auto !important;
  }

  .admin-aaa-body .aaa-knowledge-table-header,
  .admin-aaa-body .aaa-table-entry-row {
    min-width: 980px !important;
  }
}

@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar {
    position: sticky !important;
    top: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 70px !important;
    padding: 10px 14px !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--aaa-line) !important;
  }

  .admin-aaa-body .admin-aaa-shell {
    display: block !important;
  }

  .admin-aaa-body .aaa-logo-link,
  .admin-aaa-body .sidebar-logo-link.aaa-logo-link {
    min-width: 74px !important;
    height: 52px !important;
    padding: 0 !important;
    border-bottom: 0 !important;
    border-right: 1px solid var(--aaa-line) !important;
  }

  .admin-aaa-body .aaa-logo-link .aaa-lightning-logo {
    width: 26px !important;
    height: 34px !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle {
    display: inline-flex !important;
    min-width: 0 !important;
    height: 46px !important;
    border: 1px solid var(--aaa-line) !important;
    border-radius: 12px !important;
    color: #303648 !important;
    background: #ffffff !important;
    box-shadow: var(--aaa-shadow-sm) !important;
  }

  .admin-aaa-body .aaa-sidebar-nav {
    background: #ffffff !important;
    border: 1px solid var(--aaa-line) !important;
    border-radius: 16px !important;
    box-shadow: var(--aaa-shadow-lg) !important;
  }

  .admin-aaa-body .aaa-nav-link {
    min-height: 54px !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    padding: 0 14px !important;
  }

  .admin-aaa-body .aaa-topbar,
  .admin-aaa-body .topbar.aaa-topbar {
    height: auto !important;
    min-height: 70px !important;
    padding: 12px 18px !important;
    gap: 12px !important;
  }

  .admin-aaa-body .aaa-filters-row,
  .admin-aaa-body .filters-row.aaa-filters-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .admin-aaa-body .aaa-association-manager,
  .admin-aaa-body .association-manager.aaa-association-manager {
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }
}

@media (max-width: 720px) {
  .admin-aaa-body .aaa-content-area,
  .admin-aaa-body .content-area.aaa-content-area {
    padding: 24px 16px 42px !important;
  }

  .admin-aaa-body .aaa-content-header h1,
  .admin-aaa-body .content-header.aaa-content-header h1 {
    font-size: 30px !important;
  }

  .admin-aaa-body .aaa-view-toolbar {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .admin-aaa-body .aaa-view-actions {
    width: 100% !important;
    justify-content: space-between !important;
    overflow-x: auto !important;
  }

  .admin-aaa-body .aaa-view-btn {
    min-width: 76px !important;
  }

  .admin-aaa-body .aaa-view-btn span {
    display: none !important;
  }

  .admin-aaa-body .aaa-duplicate-check-btn {
    min-width: 132px !important;
  }
}

/* Remove dark-theme mobile scroll cues in the light layout. */
.admin-aaa-body .aaa-toolbar-scroll-peek,
.admin-aaa-body .aaa-toolbar-edge-fade,
.admin-aaa-body .aaa-sidebar::before,
.admin-aaa-body .aaa-sidebar::after,
.admin-aaa-body .aaa-sidebar-nav::after {
  display: none !important;
}

/* =========================================================
   LIGHT UI CONTRAST PASS + ORIGINAL PURPLE SIDEBAR RESTORE
   ========================================================= */
body.admin-aaa-body {
  --aaa-bg: #f4f6fb;
  --aaa-bg-2: #eef2f8;
  --aaa-ink: #121827;
  --aaa-ink-soft: #2f3a4f;
  --aaa-muted: #4f5b70;
  --aaa-line: #d2d9e7;
  --aaa-line-strong: #bfc9dc;
  --aaa-blue: #4f7df3;
  --aaa-violet: #6a4df5;
  --aaa-magenta: #8d6bf7;
  --aaa-green: #2e7be6;
  --aaa-danger: #b42335;
  --aaa-panel: #fbfcff;
  --aaa-frost: #fbfcff;
  --aaa-frost-light: #f6f8fc;
  --aaa-shadow-sm: 0 1px 2px rgba(19, 28, 54, 0.07);
  --aaa-shadow-md: 0 14px 34px rgba(31, 42, 74, 0.09);
  --aaa-shadow-lg: 0 24px 70px rgba(31, 42, 74, 0.14);
}

body.admin-aaa-body {
  color: var(--aaa-ink) !important;
  background:
    radial-gradient(circle at 88% 8%, rgba(106, 77, 245, 0.075), transparent 25%),
    radial-gradient(circle at 18% 84%, rgba(79, 125, 243, 0.07), transparent 28%),
    linear-gradient(180deg, #f8f9fd 0%, #f4f6fb 46%, #eef2f8 100%) !important;
}

.admin-aaa-body .aaa-main-shell,
.admin-aaa-body .main-shell.aaa-main-shell,
.admin-aaa-body .aaa-content-shell,
.admin-aaa-body .content-shell.aaa-content-shell {
  background: transparent !important;
}

/* Restore the original purple/nav treatment while keeping the page light. */
.admin-aaa-body .aaa-sidebar {
  width: 148px !important;
  min-width: 148px !important;
  background:
    radial-gradient(circle at 34% 0%, rgba(124, 53, 255, 0.26), transparent 28%),
    linear-gradient(180deg, rgba(7, 13, 40, 0.96), rgba(3, 7, 25, 0.98)) !important;
  border-right: 1px solid rgba(132, 157, 255, 0.28) !important;
  box-shadow: 18px 0 46px rgba(15, 23, 42, 0.18) !important;
  backdrop-filter: blur(24px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
}

.admin-aaa-body .aaa-logo-link,
.admin-aaa-body .sidebar-logo-link.aaa-logo-link {
  border-bottom: 1px solid rgba(205, 216, 255, 0.18) !important;
}

.admin-aaa-body .aaa-logo-link .aaa-lightning-logo,
.admin-aaa-body .aaa-lightning-logo {
  filter:
    drop-shadow(0 0 12px rgba(31, 119, 255, 0.66))
    drop-shadow(0 0 22px rgba(155, 56, 255, 0.48)) !important;
}

.admin-aaa-body .aaa-sidebar-logo-text,
.admin-aaa-body .aaa-sidebar .brand-name,
.admin-aaa-body .aaa-sidebar .powered-by {
  color: rgba(248, 251, 255, 0.94) !important;
}

.admin-aaa-body .aaa-sidebar .powered-by {
  color: rgba(219, 227, 255, 0.68) !important;
}

.admin-aaa-body .aaa-nav-link,
.admin-aaa-body .sidebar-bottom-link.aaa-nav-link {
  color: rgba(244, 248, 255, 0.86) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-nav-link span,
.admin-aaa-body .aaa-nav-link svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.admin-aaa-body .aaa-nav-link:hover {
  color: #ffffff !important;
  background: rgba(79, 92, 255, 0.16) !important;
  box-shadow: 0 0 0 1px rgba(179, 200, 255, 0.07) inset !important;
}

.admin-aaa-body .aaa-nav-link.active {
  color: #ffffff !important;
  background:
    radial-gradient(circle at top left, rgba(24, 196, 255, 0.34), transparent 36%),
    linear-gradient(135deg, rgba(28, 119, 255, 0.90), rgba(124, 53, 255, 0.86)) !important;
  box-shadow:
    0 0 0 1px rgba(179, 200, 255, 0.16) inset,
    0 12px 34px rgba(58, 74, 255, 0.30),
    0 0 34px rgba(156, 52, 255, 0.24) !important;
}

/* Softer page surfaces with stronger text contrast. */
.admin-aaa-body .aaa-topbar,
.admin-aaa-body .topbar.aaa-topbar {
  background: rgba(251, 252, 255, 0.95) !important;
  border-bottom: 1px solid var(--aaa-line) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02) !important;
}

.admin-aaa-body .aaa-topbar-title,
.admin-aaa-body .topbar-title.aaa-topbar-title,
.admin-aaa-body .aaa-content-header h1,
.admin-aaa-body .content-header.aaa-content-header h1,
.admin-aaa-body h1,
.admin-aaa-body h2,
.admin-aaa-body h3,
.admin-aaa-body .card-title,
.admin-aaa-body .knowledge-card h3,
.admin-aaa-body .aaa-category-card-copy strong,
.admin-aaa-body .analytics-panel-header h2,
.admin-aaa-body .panel-header h2,
.admin-aaa-body .summary-card strong {
  color: var(--aaa-ink) !important;
  text-shadow: none !important;
}

.admin-aaa-body .aaa-content-header p,
.admin-aaa-body .content-header.aaa-content-header p,
.admin-aaa-body .analytics-panel-header p,
.admin-aaa-body .card-content,
.admin-aaa-body .formatted-knowledge-content,
.admin-aaa-body .summary-card span,
.admin-aaa-body .summary-card small,
.admin-aaa-body .summary-card .summary-card-note,
.admin-aaa-body .support-faq-card p,
.admin-aaa-body .import-meta,
.admin-aaa-body .recycle-meta,
.admin-aaa-body .status-message,
.admin-aaa-body .empty-state,
.admin-aaa-body .field-help,
.admin-aaa-body .muted,
.admin-aaa-body .aaa-category-card-copy span,
.admin-aaa-body .aaa-table-entry-preview,
.admin-aaa-body .aaa-table-entry-category,
.admin-aaa-body .aaa-table-entry-updated {
  color: var(--aaa-muted) !important;
}

.admin-aaa-body .aaa-association-manager,
.admin-aaa-body .association-manager.aaa-association-manager,
.admin-aaa-body .aaa-customize-panel,
.admin-aaa-body .billing-card,
.admin-aaa-body .support-card,
.admin-aaa-body .support-faq-card,
.admin-aaa-body .founder-card,
.admin-aaa-body .saas-card,
.admin-aaa-body .import-card,
.admin-aaa-body .recycle-card,
.admin-aaa-body .feedback-card,
.admin-aaa-body .role-panel,
.admin-aaa-body .security-panel,
.admin-aaa-body .history-panel,
.admin-aaa-body .inquiry-panel,
.admin-aaa-body .summary-card,
.admin-aaa-body .analytics-panel,
.admin-aaa-body .aaa-analytics-panel,
.admin-aaa-body .import-bulk-toolbar,
.admin-aaa-body .support-snapshot-box,
.admin-aaa-body .latest-feedback,
.admin-aaa-body .feedback-metrics div,
.admin-aaa-body .analytics-row {
  color: var(--aaa-ink) !important;
  background: var(--aaa-panel) !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.055) !important;
}

.admin-aaa-body .aaa-association-list,
.admin-aaa-body .association-list,
.admin-aaa-body .association-list.aaa-association-list,
.admin-aaa-body .association-list *,
.admin-aaa-body .aaa-association-list *,
.admin-aaa-body .association-row,
.admin-aaa-body .association-row span,
.admin-aaa-body .association-row strong,
.admin-aaa-body .association-search-term {
  color: #3f485b !important;
}

.admin-aaa-body .association-row,
.admin-aaa-body .association-list .association-row,
.admin-aaa-body .aaa-association-list .association-row {
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
}

/* Form controls and dropdowns: no more silver-on-white. */
.admin-aaa-body input,
.admin-aaa-body textarea,
.admin-aaa-body select,
.admin-aaa-body .category-smart-select,
.admin-aaa-body .support-form input,
.admin-aaa-body .support-form textarea,
.admin-aaa-body .support-form select,
.admin-aaa-body .import-field input,
.admin-aaa-body .import-field select,
.admin-aaa-body .wage-input-wrap,
.admin-aaa-body .aaa-control-wrap,
.admin-aaa-body .search-wrap.aaa-control-wrap,
.admin-aaa-body .filter-wrap.aaa-control-wrap {
  color: #1f2937 !important;
  -webkit-text-fill-color: #1f2937 !important;
  background-color: #ffffff !important;
  border-color: var(--aaa-line) !important;
  box-shadow: var(--aaa-shadow-sm) !important;
}

.admin-aaa-body .aaa-control-wrap input,
.admin-aaa-body .aaa-control-wrap select,
.admin-aaa-body .search-wrap.aaa-control-wrap input,
.admin-aaa-body .filter-wrap.aaa-control-wrap select {
  color: #1f2937 !important;
  -webkit-text-fill-color: #1f2937 !important;
  background: transparent !important;
}

.admin-aaa-body input::placeholder,
.admin-aaa-body textarea::placeholder,
.admin-aaa-body .aaa-control-wrap input::placeholder {
  color: #667085 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #667085 !important;
}

.admin-aaa-body select:disabled,
.admin-aaa-body input:disabled,
.admin-aaa-body textarea:disabled,
.admin-aaa-body select option[value=""] {
  color: #5f687d !important;
  -webkit-text-fill-color: #5f687d !important;
  opacity: 1 !important;
}

.admin-aaa-body select option,
.admin-aaa-body .knowledge-editor-panel select option,
.admin-aaa-body .knowledge-editor-panel #categorySelect option {
  color: #1f2937 !important;
  background: #ffffff !important;
}

.admin-aaa-body .aaa-control-icon {
  color: #4f5b70 !important;
  stroke: currentColor !important;
}

.admin-aaa-body .aaa-control-wrap::after,
.admin-aaa-body .filter-wrap.aaa-control-wrap::after {
  border-right: 2px solid #5f687d !important;
  border-bottom: 2px solid #5f687d !important;
}

.admin-aaa-body .aaa-shortcut {
  color: #4f5b70 !important;
  background: #f3f5fa !important;
  border-color: var(--aaa-line) !important;
}

/* Founder collapsed cards were inheriting low-contrast dark-theme text. */
.admin-aaa-body .founder-collapsible-section {
  background: var(--aaa-panel) !important;
  border-color: var(--aaa-line) !important;
}

.admin-aaa-body .founder-collapsible-section > .analytics-panel-header h2,
.admin-aaa-body .founder-collapsible-section > .analytics-panel-header p,
.admin-aaa-body .founder-toggle-line,
.admin-aaa-body .founder-toggle-line span,
.admin-aaa-body .founder-form-subhead {
  color: var(--aaa-ink) !important;
}

.admin-aaa-body .founder-collapsible-section > .analytics-panel-header p {
  color: var(--aaa-muted) !important;
}

.admin-aaa-body .founder-collapse-indicator {
  color: #6047e8 !important;
  background: #f1ecff !important;
  border: 1px solid #ded5ff !important;
  box-shadow: none !important;
}

/* Knowledge Manager card view: light cards with readable previews. */
.admin-aaa-body .knowledge-card,
.admin-aaa-body .aaa-knowledge-grid .knowledge-card,
.admin-aaa-body .knowledge-grid.aaa-knowledge-grid .knowledge-card,
.admin-aaa-body .aaa-category-card,
.admin-aaa-body .aaa-category-card-grid-item .aaa-category-card,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card,
.admin-aaa-body .aaa-category-card-group .aaa-category-card,
.admin-aaa-body .aaa-category-card-group.expanded .aaa-category-card,
.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item .aaa-category-card {
  color: var(--aaa-ink) !important;
  background:
    radial-gradient(circle at 92% 12%, rgba(106, 77, 245, 0.08), transparent 30%),
    linear-gradient(145deg, #ffffff 0%, #f8f9fd 100%) !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.075) !important;
}

.admin-aaa-body .knowledge-card::before,
.admin-aaa-body .aaa-knowledge-grid .knowledge-card::before {
  display: none !important;
}

.admin-aaa-body .knowledge-card:hover,
.admin-aaa-body .aaa-category-card:hover,
.admin-aaa-body .aaa-category-card-grid-item:hover .aaa-category-card {
  background:
    radial-gradient(circle at 92% 12%, rgba(106, 77, 245, 0.10), transparent 30%),
    linear-gradient(145deg, #ffffff 0%, #f5f7fc 100%) !important;
  border-color: var(--aaa-line-strong) !important;
  box-shadow: var(--aaa-shadow-md) !important;
}

.admin-aaa-body .aaa-category-card-icon,
.admin-aaa-body .aaa-category-list-icon,
.admin-aaa-body .aaa-section-icon {
  color: #ffffff !important;
  background: linear-gradient(135deg, #4f7df3, #6a4df5) !important;
  box-shadow: 0 10px 24px rgba(98, 69, 220, 0.18) !important;
}

.admin-aaa-body .category-badge,
.admin-aaa-body .status-badge,
.admin-aaa-body .topic-label,
.admin-aaa-body .aaa-duplicate-type,
.admin-aaa-body .aaa-duplicate-review-score,
.admin-aaa-body .aaa-section-eyebrow {
  color: #4f35d7 !important;
  background: #eee9ff !important;
  border: 1px solid #d8ceff !important;
  box-shadow: none !important;
}

.admin-aaa-body .status-badge.status-active,
.admin-aaa-body .status-active,
.admin-aaa-body .aaa-table-entry-status.active {
  color: #1f2937 !important;
  background: #eef6ff !important;
  border-color: #cfe2ff !important;
}

.admin-aaa-body .status-active::before,
.admin-aaa-body .aaa-table-entry-status span,
.admin-aaa-body .aaa-status-dot.active {
  background: #2e7be6 !important;
  box-shadow: 0 0 0 3px rgba(46, 123, 230, 0.12) !important;
}

.admin-aaa-body .featured-btn {
  color: #9aa3b5 !important;
  text-shadow: none !important;
}

.admin-aaa-body .featured-btn:hover,
.admin-aaa-body .featured-btn.featured-active {
  color: #d97706 !important;
  text-shadow: 0 0 12px rgba(217, 119, 6, 0.18) !important;
}

.admin-aaa-body .card-title,
.admin-aaa-body .knowledge-card h3,
.admin-aaa-body .aaa-category-card-copy strong {
  color: var(--aaa-ink) !important;
}

.admin-aaa-body .card-content,
.admin-aaa-body .knowledge-card .card-content,
.admin-aaa-body .formatted-knowledge-content {
  color: #3f485b !important;
}

.admin-aaa-body .card-divider {
  background: var(--aaa-line) !important;
  border-color: var(--aaa-line) !important;
}

.admin-aaa-body .aaa-category-card-count,
.admin-aaa-body .aaa-view-count {
  color: #4f35d7 !important;
  background: #eee9ff !important;
  border: 1px solid #d8ceff !important;
}

.admin-aaa-body .aaa-category-card-chevron,
.admin-aaa-body .aaa-table-chevron {
  color: #4f5b70 !important;
  stroke: currentColor !important;
}

.admin-aaa-body .aaa-category-card-preview {
  background: #f3f5fa !important;
  border: 1px solid var(--aaa-line) !important;
  mask-image: none !important;
}

.admin-aaa-body .aaa-category-preview-line {
  background: #ffffff !important;
  border: 1px solid #dfe5f0 !important;
}

.admin-aaa-body .aaa-category-preview-line span {
  color: #4f35d7 !important;
  background: #eee9ff !important;
}

.admin-aaa-body .aaa-category-preview-line p {
  color: #3f485b !important;
}

.admin-aaa-body .edit-btn,
.admin-aaa-body .aaa-table-action-btn,
.admin-aaa-body .card-btn {
  color: #1f2937 !important;
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: var(--aaa-shadow-sm) !important;
}

.admin-aaa-body .delete-btn,
.admin-aaa-body .danger-outline-btn,
.admin-aaa-body .aaa-editor-delete-btn {
  color: #b42335 !important;
  background: #fff5f6 !important;
  border: 1px solid #efc6cc !important;
}

/* Table/list surfaces should stay slightly off-white rather than stark white. */
.admin-aaa-body .aaa-knowledge-table-shell,
.admin-aaa-body .aaa-knowledge-table-header,
.admin-aaa-body .aaa-table-category-row,
.admin-aaa-body .aaa-table-entry-row,
.admin-aaa-body table,
.admin-aaa-body .history-table,
.admin-aaa-body .role-table,
.admin-aaa-body .billing-table,
.admin-aaa-body .audit-table,
.admin-aaa-body .data-table,
.admin-aaa-body th,
.admin-aaa-body td {
  color: var(--aaa-ink) !important;
  background: var(--aaa-panel) !important;
  border-color: var(--aaa-line) !important;
}

.admin-aaa-body .aaa-table-category-group:nth-of-type(even) .aaa-table-category-row,
.admin-aaa-body .aaa-table-entry-row:hover,
.admin-aaa-body .table-row:hover,
.admin-aaa-body .history-row:hover,
.admin-aaa-body .role-row:hover {
  background: #f6f8fc !important;
}

/* Keep mobile/sidebar dropdowns readable with the restored purple sidebar. */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar {
    background:
      radial-gradient(circle at 20% 0%, rgba(124, 53, 255, 0.28), transparent 30%),
      linear-gradient(180deg, rgba(7, 13, 40, 0.98), rgba(3, 7, 25, 0.99)) !important;
    border-bottom: 1px solid rgba(132, 157, 255, 0.28) !important;
  }

  .admin-aaa-body .aaa-sidebar-nav {
    background:
      linear-gradient(180deg, rgba(7, 13, 40, 0.98), rgba(3, 7, 25, 0.99)) !important;
    border: 1px solid rgba(132, 157, 255, 0.28) !important;
  }

  .admin-aaa-body .aaa-logo-link,
  .admin-aaa-body .sidebar-logo-link.aaa-logo-link {
    border-right: 1px solid rgba(205, 216, 255, 0.18) !important;
  }
}


/* =========================================================
   FINAL OVERRIDE: FONT STACK + FULL VIEWPORT FILL
   ========================================================= */
body.admin-aaa-body {
  --instint-font-main: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --instint-font-code: "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, monospace;
}

html,
body.admin-aaa-body,
.admin-aaa-body button,
.admin-aaa-body input,
.admin-aaa-body select,
.admin-aaa-body textarea {
  font-family: var(--instint-font-main) !important;
}

.admin-aaa-body code,
.admin-aaa-body kbd,
.admin-aaa-body pre,
.admin-aaa-body samp,
.admin-aaa-body .founder-created-meta code,
.admin-aaa-body .security-mfa-secret code,
.admin-aaa-body .role-mfa-secret code,
.admin-aaa-body #branchCodeInput,
.admin-aaa-body #clientBranchCode,
.admin-aaa-body #roleCode,
.admin-aaa-body #userEmployeeCode,
.admin-aaa-body #userNewRoleCode,
.admin-aaa-body #selfMfaCode,
.admin-aaa-body #reauthMfaCode,
.admin-aaa-body #newFounderMfaCode,
.admin-aaa-body .founder-mfa-confirm-code,
.admin-aaa-body .role-mfa-code-input,
.admin-aaa-body .role-login-code,
.admin-aaa-body .role-user-code,
.admin-aaa-body .roles-code-preview strong,
.admin-aaa-body .role-generated-box strong {
  font-family: var(--instint-font-code) !important;
}

html,
body.admin-aaa-body {
  min-height: 100%;
}

body.dashboard-body.admin-aaa-body,
body.admin-aaa-body {
  min-height: 100vh !important;
  min-height: 100dvh !important;
}

.admin-aaa-body .admin-aaa-shell,
.admin-aaa-body .dashboard-shell.admin-aaa-shell {
  min-height: 100vh !important;
  min-height: 100dvh !important;
  align-items: stretch !important;
}

.admin-aaa-body .aaa-main-shell {
  min-height: 100vh !important;
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
}

.admin-aaa-body .aaa-content-shell {
  flex: 1 1 auto !important;
  min-height: calc(100vh - 78px) !important;
  min-height: calc(100dvh - 78px) !important;
}

.admin-aaa-body .aaa-content-area {
  min-height: calc(100vh - 78px) !important;
}

.admin-aaa-body .aaa-sidebar {
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  align-self: stretch !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(132, 157, 255, 0.34) transparent;
}

.admin-aaa-body .aaa-sidebar::-webkit-scrollbar {
  width: 6px;
}

.admin-aaa-body .aaa-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.admin-aaa-body .aaa-sidebar::-webkit-scrollbar-thumb {
  background: rgba(132, 157, 255, 0.34);
  border-radius: 999px;
}

@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar {
    height: auto !important;
    max-height: none !important;
    overflow-y: hidden !important;
    overflow-x: auto !important;
  }

  .admin-aaa-body .aaa-content-shell,
  .admin-aaa-body .aaa-content-area {
    min-height: auto !important;
  }
}

/* =========================================================
   FINAL OVERRIDE: CRISPER ADMIN FONT WEIGHTS
   Segoe UI looks cleaner when it stays within native 400/500/600/700 weights.
   ========================================================= */
.admin-aaa-body,
.admin-aaa-body button,
.admin-aaa-body input,
.admin-aaa-body select,
.admin-aaa-body textarea {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
}

/* =========================================================
   FINAL OVERRIDE: Knowledge Manager table row contrast
   Strengthens alternating row color and separates category headers.
   ========================================================= */
.admin-aaa-body .aaa-knowledge-table-shell {
  border-color: #c7d2e3 !important;
  background: #ffffff !important;
}

.admin-aaa-body .aaa-knowledge-table-header {
  color: #1f2937 !important;
  background: #f4f6fa !important;
  border-bottom: 1px solid #c7d2e3 !important;
}

.admin-aaa-body .aaa-table-category-row {
  color: #1f2937 !important;
  background: #edf1f7 !important;
  border-bottom: 1px solid #c7d2e3 !important;
}

.admin-aaa-body .aaa-table-category-group:nth-of-type(even) .aaa-table-category-row {
  background: #e7edf6 !important;
}

.admin-aaa-body .aaa-table-category-group.expanded .aaa-table-category-row {
  background: #e3eaf5 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.70), inset 0 -1px 0 #c7d2e3 !important;
}

.admin-aaa-body .aaa-table-category-name,
.admin-aaa-body .aaa-table-category-name strong {
  color: #111827 !important;
}

.admin-aaa-body .aaa-table-category-meta {
  color: #475569 !important;
}

.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row {
  border-bottom: 1px solid #d4dce8 !important;
}

.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row:nth-of-type(odd) {
  background: #ffffff !important;
}

.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row:nth-of-type(even) {
  background: #f2f5fa !important;
}

.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row:hover,
.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row:nth-of-type(even):hover,
.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row:nth-of-type(odd):hover {
  background: #eaf0fb !important;
}

.admin-aaa-body .aaa-table-entry-category,
.admin-aaa-body .aaa-table-entry-preview,
.admin-aaa-body .aaa-table-entry-updated {
  color: #344054 !important;
}

.admin-aaa-body .aaa-table-entry-title {
  color: #0f172a !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-table-entry-status {
  color: #1f2937 !important;
}

.admin-aaa-body .aaa-table-entry-status.active {
  background: #eef4ff !important;
  border: 1px solid #d7e4ff !important;
  border-radius: 999px !important;
  padding: 4px 9px !important;
  width: fit-content !important;
}

.admin-aaa-body .aaa-table-entry-updated {
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-table-action-btn {
  border-color: #c5cfdd !important;
  color: #111827 !important;
  background: #ffffff !important;
}

.admin-aaa-body .aaa-table-action-btn:hover {
  background: #eef2f8 !important;
  border-color: #b7c2d2 !important;
}

/* =========================================================
   FINAL OVERRIDE: Softer Knowledge Manager rows + standard weights
   Makes expanded entry rows lighter, less visually busy, and uses green active status.
   ========================================================= */
.admin-aaa-body .aaa-knowledge-table-shell {
  border-color: #d4dce8 !important;
  background: #ffffff !important;
}

.admin-aaa-body .aaa-knowledge-table-header {
  min-height: 44px !important;
  color: #273244 !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #d4dce8 !important;
  font-weight: 600 !important;
  letter-spacing: 0.015em !important;
}

.admin-aaa-body .aaa-table-category-row {
  color: #1f2937 !important;
  background: #f1f5f9 !important;
  border-bottom: 1px solid #d4dce8 !important;
  font-weight: 500 !important;
}

.admin-aaa-body .aaa-table-category-group:nth-of-type(even) .aaa-table-category-row {
  background: #eef3f8 !important;
}

.admin-aaa-body .aaa-table-category-group.expanded .aaa-table-category-row {
  background: #eaf1f8 !important;
  border-bottom-color: #cfd8e6 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.76), inset 0 -1px 0 #cfd8e6 !important;
}

.admin-aaa-body .aaa-table-category-name,
.admin-aaa-body .aaa-table-category-name strong {
  color: #111827 !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-table-category-meta {
  color: #4b5563 !important;
  font-weight: 500 !important;
}

.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row {
  color: #253044 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  font-weight: 400 !important;
}

.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row:nth-of-type(odd) {
  background: #ffffff !important;
}

.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row:nth-of-type(even) {
  background: #f8fafc !important;
}

.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row:hover,
.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row:nth-of-type(even):hover,
.admin-aaa-body .aaa-table-category-entries .aaa-table-entry-row:nth-of-type(odd):hover {
  background: #f2f6fb !important;
}

.admin-aaa-body .aaa-table-entry-category,
.admin-aaa-body .aaa-table-entry-updated {
  color: #4b5563 !important;
  font-weight: 400 !important;
}

.admin-aaa-body .aaa-table-entry-title {
  color: #111827 !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-table-entry-preview {
  color: #374151 !important;
  font-weight: 400 !important;
}

.admin-aaa-body .aaa-table-entry-status {
  color: #374151 !important;
  font-weight: 500 !important;
}

.admin-aaa-body .aaa-table-entry-status.active,
.admin-aaa-body .status-badge.status-active,
.admin-aaa-body .status-active {
  color: #166534 !important;
  background: #ecfdf3 !important;
  border: 1px solid #bbf7d0 !important;
}

.admin-aaa-body .aaa-table-entry-status.active {
  border-radius: 999px !important;
  padding: 4px 9px !important;
  width: fit-content !important;
}

.admin-aaa-body .aaa-table-entry-status span,
.admin-aaa-body .status-active::before,
.admin-aaa-body .aaa-status-dot.active {
  background: #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14) !important;
}

.admin-aaa-body .aaa-table-entry-status.inactive {
  color: #64748b !important;
  background: #f1f5f9 !important;
  border: 1px solid #dbe3ef !important;
  border-radius: 999px !important;
  padding: 4px 9px !important;
  width: fit-content !important;
  font-weight: 500 !important;
}

.admin-aaa-body .aaa-table-entry-status.inactive span,
.admin-aaa-body .status-inactive::before {
  background: #94a3b8 !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-table-action-btn {
  border-color: #cbd5e1 !important;
  color: #111827 !important;
  background: #ffffff !important;
  font-weight: 500 !important;
}

.admin-aaa-body .aaa-table-action-btn:hover {
  background: #f8fafc !important;
  border-color: #b6c2d2 !important;
}

/* Keep card/check active indicators green without creating a filled pseudo badge. */
.admin-aaa-body .status-badge.status-active::before,
.admin-aaa-body .aaa-knowledge-grid .status-active::before {
  color: #22c55e !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* =========================================================
   FINAL OVERRIDE: Knowledge table category rows use requested purple
   Keeps entry/detail rows unchanged.
   ========================================================= */
.admin-aaa-body .aaa-table-category-row,
.admin-aaa-body .aaa-table-category-group:nth-of-type(even) .aaa-table-category-row,
.admin-aaa-body .aaa-table-category-group.expanded .aaa-table-category-row {
  background: #e8e9f7 !important;
  border-bottom-color: #c9cbe8 !important;
}

.admin-aaa-body .aaa-table-category-group.expanded .aaa-table-category-row {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.78),
    inset 0 -1px 0 #c9cbe8 !important;
}

.admin-aaa-body .aaa-table-category-row:hover,
.admin-aaa-body .aaa-table-category-group:nth-of-type(even) .aaa-table-category-row:hover,
.admin-aaa-body .aaa-table-category-group.expanded .aaa-table-category-row:hover {
  background: #e8e9f7 !important;
}


/* =========================================================
   FINAL: Duplicate Detection light theme refinement
   ========================================================= */
.admin-aaa-body .aaa-duplicates-page .aaa-duplicates-toolbar,
.admin-aaa-body .aaa-duplicate-summary-card,
.admin-aaa-body .aaa-duplicate-bucket,
.admin-aaa-body .aaa-duplicate-workspace,
.admin-aaa-body .aaa-duplicate-left-panel,
.admin-aaa-body .aaa-duplicate-analysis-panel,
.admin-aaa-body .aaa-previously-not-duplicate-toolbar {
  color: var(--aaa-ink) !important;
  background: rgba(250, 251, 255, 0.88) !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.06) !important;
}

.admin-aaa-body .aaa-duplicates-toolbar {
  padding: 16px 18px !important;
  border-radius: 20px !important;
}

.admin-aaa-body .aaa-duplicates-toolbar .aaa-view-summary strong,
.admin-aaa-body .aaa-duplicate-section-heading h2,
.admin-aaa-body .aaa-duplicate-workspace h3,
.admin-aaa-body .aaa-duplicate-workspace-header strong,
.admin-aaa-body .aaa-duplicate-analysis-panel strong,
.admin-aaa-body .aaa-duplicate-analysis-panel .aaa-analysis-title,
.admin-aaa-body .aaa-analysis-block > strong,
.admin-aaa-body .aaa-duplicate-setting span,
.admin-aaa-body .aaa-duplicate-page-kicker,
.admin-aaa-body .aaa-duplicate-header-actions span,
.admin-aaa-body .aaa-entry-card-top span {
  color: #172033 !important;
  text-shadow: none !important;
}

.admin-aaa-body .aaa-duplicate-workspace-header p,
.admin-aaa-body .aaa-duplicate-section-heading p,
.admin-aaa-body .aaa-duplicate-analysis-panel p,
.admin-aaa-body .aaa-analysis-score-line em,
.admin-aaa-body .aaa-analysis-block ul,
.admin-aaa-body .duplicate-meta,
.admin-aaa-body .aaa-previously-not-duplicate-toolbar label,
.admin-aaa-body .aaa-previously-not-duplicate-select {
  color: #546078 !important;
}

.admin-aaa-body .aaa-duplicate-setting select,
.admin-aaa-body .aaa-previously-not-duplicate-select,
.admin-aaa-body .aaa-previously-not-duplicate-toolbar select {
  min-height: 44px !important;
  color: #172033 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid #cfd7e8 !important;
  box-shadow: 0 8px 20px rgba(31, 42, 74, 0.05) !important;
}

.admin-aaa-body .aaa-duplicate-setting select option {
  background: #ffffff !important;
  color: #172033 !important;
}

.admin-aaa-body .aaa-duplicate-summary-grid {
  gap: 14px !important;
}

.admin-aaa-body .aaa-duplicate-summary-card {
  min-height: 104px !important;
  border-radius: 17px !important;
}

.admin-aaa-body .aaa-duplicate-summary-card strong {
  color: #6047e8 !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-duplicate-summary-card span {
  color: #5a657c !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-duplicate-jump-nav {
  background: rgba(250, 251, 255, 0.95) !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.08) !important;
}

.admin-aaa-body .aaa-duplicate-jump-nav span {
  color: #65708a !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-duplicate-jump-nav a {
  color: #172033 !important;
  background: #f4f6fb !important;
  border-color: #d3daea !important;
}

.admin-aaa-body .aaa-duplicate-jump-nav a:hover {
  color: #4f37d6 !important;
  background: #f1ecff !important;
  border-color: #d8ccff !important;
}

.admin-aaa-body .aaa-duplicate-jump-nav a em,
.admin-aaa-body .aaa-bucket-count {
  color: #6047e8 !important;
  background: #eee8ff !important;
  border: 1px solid #d9ceff !important;
}

.admin-aaa-body .aaa-duplicate-workspace {
  padding: 0 !important;
  overflow: hidden !important;
}

.admin-aaa-body .aaa-duplicate-workspace::before {
  display: none !important;
}

.admin-aaa-body .aaa-duplicate-workspace-header {
  border-bottom: 1px solid #d8deeb !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,255,0.82)) !important;
}

.admin-aaa-body .aaa-duplicate-signal-dot {
  width: 11px !important;
  height: 11px !important;
  background: #ef476f !important;
  box-shadow: 0 0 0 4px rgba(239, 71, 111, 0.10) !important;
}

.admin-aaa-body .aaa-duplicate-headline-row em,
.admin-aaa-body .aaa-analysis-score-line strong {
  color: #d9294d !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-duplicate-entry-grid {
  gap: 14px !important;
}

.admin-aaa-body .aaa-duplicate-workspace .aaa-entry-card-a,
.admin-aaa-body .aaa-merge-source-card:first-child {
  color: #172033 !important;
  border-color: rgba(64, 122, 214, 0.42) !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(64, 122, 214, 0.24), transparent 42%),
    linear-gradient(135deg, rgba(64, 122, 214, 0.18), rgba(255, 255, 255, 0.96) 66%) !important;
}

.admin-aaa-body .aaa-duplicate-workspace .aaa-entry-card-b,
.admin-aaa-body .aaa-merge-source-card:nth-child(2) {
  color: #172033 !important;
  border-color: rgba(118, 82, 224, 0.42) !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(118, 82, 224, 0.24), transparent 42%),
    linear-gradient(135deg, rgba(118, 82, 224, 0.17), rgba(255, 255, 255, 0.96) 66%) !important;
}

.admin-aaa-body .aaa-entry-card-a .aaa-entry-card-top small {
  color: #245eae !important;
  background: rgba(64, 122, 214, 0.13) !important;
  border: 1px solid rgba(64, 122, 214, 0.22) !important;
}

.admin-aaa-body .aaa-entry-card-b .aaa-entry-card-top small {
  color: #6047d8 !important;
  background: rgba(118, 82, 224, 0.13) !important;
  border: 1px solid rgba(118, 82, 224, 0.22) !important;
}

.admin-aaa-body .aaa-duplicate-workspace .duplicate-content,
.admin-aaa-body .aaa-merge-source-card .duplicate-content {
  color: #3f485b !important;
  background: rgba(255, 255, 255, 0.62) !important;
  border: 1px solid rgba(204, 213, 230, 0.84) !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-duplicate-analysis-panel {
  background: #ffffff !important;
}

.admin-aaa-body .aaa-analysis-icon {
  color: #6047e8 !important;
  background: #f1ecff !important;
  border-color: #d9ceff !important;
}

.admin-aaa-body .aaa-duplicate-analysis-panel .aaa-term-pill {
  color: #5a657c !important;
  background: #f5f7fb !important;
  border-color: #d8deeb !important;
}

.admin-aaa-body .aaa-duplicate-primary-actions button strong {
  color: #172033 !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-duplicate-primary-actions button span {
  color: #6a748b !important;
  font-weight: 500 !important;
}

.admin-aaa-body .aaa-merge-review-btn strong,
.admin-aaa-body .aaa-merge-review-btn span,
.admin-aaa-body .aaa-auto-merge-btn strong,
.admin-aaa-body .aaa-auto-merge-btn span {
  color: #ffffff !important;
}

/* =========================================================
   FINAL: Founder pre-client sidebar mode
   ========================================================= */
.admin-aaa-body.aaa-founder-no-client-nav .aaa-sidebar-nav {
  margin-top: 6px !important;
}

.admin-aaa-body.aaa-founder-no-client-nav .aaa-sidebar-nav .aaa-nav-link {
  min-height: 68px !important;
}

/* =========================================================
   FINAL: SaaS Dashboard light theme and controls
   ========================================================= */
.admin-aaa-body .aaa-saas-view-panel {
  margin: 0 0 22px !important;
  padding: 18px !important;
  border: 1px solid var(--aaa-line) !important;
  border-radius: 20px !important;
  background: rgba(250, 251, 255, 0.88) !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.06) !important;
}

.admin-aaa-body .aaa-saas-view-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-aaa-body .aaa-saas-view-title-wrap span,
.admin-aaa-body .aaa-saas-control span,
.admin-aaa-body .aaa-saas-labor-row small {
  color: #65708a !important;
  font-size: 0.82rem;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-saas-view-title-wrap strong {
  color: #172033 !important;
  font-size: 1.05rem;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-saas-controls-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 170px 150px 150px auto;
  gap: 12px;
  align-items: end;
}

.admin-aaa-body .aaa-saas-control {
  display: grid;
  gap: 7px;
}

.admin-aaa-body .aaa-saas-control select,
.admin-aaa-body .aaa-saas-control input,
.admin-aaa-body .aaa-saas-wage-inline input {
  color: #172033 !important;
  background: #ffffff !important;
  border: 1px solid #cfd7e8 !important;
  box-shadow: 0 8px 20px rgba(31, 42, 74, 0.05) !important;
}

.admin-aaa-body .aaa-saas-control select,
.admin-aaa-body .aaa-saas-control input {
  width: 100%;
  min-height: 44px;
  border-radius: 13px;
  padding: 0 14px;
}

.admin-aaa-body .aaa-saas-control[hidden],
.admin-aaa-body .aaa-saas-custom-date[hidden] {
  display: none !important;
}

.admin-aaa-body .analytics-summary-grid.aaa-summary-grid .summary-card,
.admin-aaa-body .aaa-analytics-grid .aaa-analytics-panel,
.admin-aaa-body .aaa-analytics-grid .analytics-panel,
.admin-aaa-body .analytics-row {
  color: var(--aaa-ink) !important;
  background: rgba(250, 251, 255, 0.90) !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.055) !important;
}

.admin-aaa-body .analytics-row:nth-child(even) {
  background: #f7f9fd !important;
}

.admin-aaa-body .analytics-row strong,
.admin-aaa-body .summary-card strong {
  color: #172033 !important;
  font-weight: 700 !important;
}

.admin-aaa-body .analytics-row span,
.admin-aaa-body .summary-card span,
.admin-aaa-body .summary-card small {
  color: #4a556d !important;
}

.admin-aaa-body .summary-card.danger strong,
.admin-aaa-body .summary-card.warning strong {
  color: #b4233d !important;
}

.admin-aaa-body .aaa-saas-labor-row {
  align-items: center;
  display: flex !important;
  justify-content: space-between;
  gap: 16px;
}

.admin-aaa-body .aaa-saas-labor-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-aaa-body .aaa-saas-wage-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid #cfd7e8;
  background: #ffffff;
}

.admin-aaa-body .aaa-saas-wage-inline span,
.admin-aaa-body .aaa-saas-wage-inline em {
  color: #65708a !important;
  font-style: normal;
  font-weight: 600;
}

.admin-aaa-body .aaa-saas-wage-inline input {
  width: 82px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  text-align: right;
}

.admin-aaa-body #saveSaasWageBtn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

@media (max-width: 1280px) {
  .admin-aaa-body .aaa-saas-controls-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-aaa-body .aaa-saas-controls-grid {
    grid-template-columns: 1fr;
  }

  .admin-aaa-body .aaa-saas-labor-row {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-aaa-body .aaa-saas-labor-controls {
    justify-content: flex-start;
  }
}

/* =========================================================
   FINAL OVERRIDE: Light modal/prompt refresh
   Keeps editor prompts aligned with the current light UI.
   ========================================================= */
.admin-aaa-body .knowledge-editor-panel.aaa-editor-panel,
.admin-aaa-body #editorPanel.knowledge-editor-panel,
.admin-aaa-body #rolePanel.knowledge-editor-panel {
  background: rgba(15, 23, 42, 0.38) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-left: 0 !important;
  box-shadow: none !important;
  color: #111827 !important;
}

.admin-aaa-body .knowledge-editor-panel.aaa-editor-panel > .panel-header,
.admin-aaa-body .knowledge-editor-panel.aaa-editor-panel > .panel-body,
.admin-aaa-body #editorPanel > .panel-header,
.admin-aaa-body #editorPanel > .panel-body,
.admin-aaa-body #rolePanel > .panel-header,
.admin-aaa-body #rolePanel > .panel-body {
  width: min(900px, calc(100vw - 48px)) !important;
  background: #fbfcff !important;
  color: #111827 !important;
  border-color: #d4dce8 !important;
  box-shadow: none !important;
}

.admin-aaa-body .knowledge-editor-panel.aaa-editor-panel > .panel-header,
.admin-aaa-body #editorPanel > .panel-header,
.admin-aaa-body #rolePanel > .panel-header {
  border-radius: 20px 20px 0 0 !important;
  border: 1px solid #d4dce8 !important;
  border-bottom: 0 !important;
  padding: 18px 22px !important;
}

.admin-aaa-body .knowledge-editor-panel.aaa-editor-panel > .panel-body,
.admin-aaa-body #editorPanel > .panel-body,
.admin-aaa-body #rolePanel > .panel-body {
  border-radius: 0 0 20px 20px !important;
  border: 1px solid #d4dce8 !important;
  border-top: 0 !important;
  padding: 20px 22px 22px !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18) !important;
}

.admin-aaa-body .knowledge-editor-panel h2,
.admin-aaa-body .knowledge-editor-panel .panel-title,
.admin-aaa-body .knowledge-editor-panel .panel-header h2 {
  color: #111827 !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

.admin-aaa-body .knowledge-editor-panel .panel-header p,
.admin-aaa-body .knowledge-editor-panel .field-label,
.admin-aaa-body .knowledge-editor-panel label,
.admin-aaa-body .knowledge-editor-panel .toggle-row,
.admin-aaa-body .knowledge-editor-panel .toggle-row span,
.admin-aaa-body .knowledge-editor-panel .role-field-hint,
.admin-aaa-body .knowledge-editor-panel .role-generated-box span {
  color: #344054 !important;
  font-weight: 500 !important;
}

.admin-aaa-body .knowledge-editor-panel input[type="text"],
.admin-aaa-body .knowledge-editor-panel input[type="email"],
.admin-aaa-body .knowledge-editor-panel input[type="password"],
.admin-aaa-body .knowledge-editor-panel input[type="number"],
.admin-aaa-body .knowledge-editor-panel textarea,
.admin-aaa-body .knowledge-editor-panel select,
.admin-aaa-body .knowledge-editor-panel .category-smart-select,
.admin-aaa-body .knowledge-editor-panel #title,
.admin-aaa-body .knowledge-editor-panel #categorySelect,
.admin-aaa-body .knowledge-editor-panel .role-security-select {
  color-scheme: light !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}

.admin-aaa-body .knowledge-editor-panel select,
.admin-aaa-body .knowledge-editor-panel .category-smart-select,
.admin-aaa-body .knowledge-editor-panel .role-security-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 46px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235f687d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 18px !important;
}

.admin-aaa-body .knowledge-editor-panel select option,
.admin-aaa-body .knowledge-editor-panel #categorySelect option,
.admin-aaa-body .knowledge-editor-panel .role-security-select option {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: #ffffff !important;
}

.admin-aaa-body .knowledge-editor-panel input::placeholder,
.admin-aaa-body .knowledge-editor-panel textarea::placeholder {
  color: #667085 !important;
  -webkit-text-fill-color: #667085 !important;
}

.admin-aaa-body .knowledge-editor-panel textarea {
  min-height: 150px !important;
  max-height: 34vh !important;
  line-height: 1.55 !important;
}

.admin-aaa-body .knowledge-editor-panel .panel-actions {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-top: 18px !important;
}

.admin-aaa-body .knowledge-editor-panel .secondary-btn,
.admin-aaa-body .knowledge-editor-panel .panel-actions .secondary-btn {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
}

.admin-aaa-body .knowledge-editor-panel .danger-outline-btn,
.admin-aaa-body .knowledge-editor-panel .aaa-editor-delete-btn {
  color: #b42318 !important;
  -webkit-text-fill-color: #b42318 !important;
  background: #fff7f7 !important;
  border: 1px solid #fecaca !important;
  box-shadow: none !important;
}

.admin-aaa-body .knowledge-editor-panel #saveBtn,
.admin-aaa-body .knowledge-editor-panel #saveRoleBtn,
.admin-aaa-body .knowledge-editor-panel .primary-btn {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #12b981 !important;
  border: 1px solid #10a673 !important;
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.18) !important;
}

.admin-aaa-body .knowledge-editor-panel #improveKnowledgeBtn,
.admin-aaa-body .knowledge-editor-panel .improve-draft-btn {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
}

.admin-aaa-body .knowledge-editor-panel .icon-btn {
  color: #344054 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
}

@media (max-width: 900px) {
  .admin-aaa-body .knowledge-editor-panel.aaa-editor-panel > .panel-header,
  .admin-aaa-body .knowledge-editor-panel.aaa-editor-panel > .panel-body,
  .admin-aaa-body #editorPanel > .panel-header,
  .admin-aaa-body #editorPanel > .panel-body,
  .admin-aaa-body #rolePanel > .panel-header,
  .admin-aaa-body #rolePanel > .panel-body {
    width: calc(100vw - 20px) !important;
  }

  .admin-aaa-body .knowledge-editor-panel .panel-actions {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   FINAL FIX: Import, Support, Duplicate, and AI preview polish
   ========================================================= */

/* AI Improved Knowledge Entry should preview in the same formatted style as a live answer/card. */
.admin-aaa-body #knowledgeAiOverlay .duplicate-modal {
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22) !important;
}

.admin-aaa-body #knowledgeAiOverlay .duplicate-header,
.admin-aaa-body #knowledgeAiOverlay .duplicate-actions {
  background: #fbfcff !important;
  border-color: #d4dce8 !important;
}

.admin-aaa-body #knowledgeAiOverlay .duplicate-header h2,
.admin-aaa-body #knowledgeAiOverlay .duplicate-column h3 {
  color: #111827 !important;
  font-weight: 700 !important;
}

.admin-aaa-body #knowledgeAiOverlay .duplicate-header p,
.admin-aaa-body #knowledgeAiOverlay .duplicate-meta {
  color: #526078 !important;
}

.admin-aaa-body #knowledgeAiOverlay .topic-label {
  color: #6047e8 !important;
  background: #f0ecff !important;
  border: 1px solid #d9ceff !important;
  border-radius: 9px !important;
  padding: 4px 8px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
}

.admin-aaa-body #knowledgeAiOverlay .duplicate-column {
  background: #ffffff !important;
  border-color: #d4dce8 !important;
}

.admin-aaa-body #knowledgeAiOverlay .duplicate-content.aaa-ai-preview-content,
.admin-aaa-body #knowledgeAiOverlay .duplicate-content.formatted-knowledge-content {
  margin-top: 12px !important;
  min-height: 240px !important;
  max-height: 46vh !important;
  overflow: auto !important;
  padding: 18px 20px !important;
  color: #334155 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  white-space: normal !important;
  line-height: 1.58 !important;
}

.admin-aaa-body #knowledgeAiOverlay .formatted-content-line {
  color: inherit !important;
  font-weight: 400 !important;
}

.admin-aaa-body #knowledgeAiOverlay .formatted-content-bullet {
  padding-left: 1.15em !important;
  text-indent: -0.85em !important;
}

.admin-aaa-body #knowledgeAiOverlay .formatted-content-spacer {
  min-height: 0.8em !important;
}

.admin-aaa-body #knowledgeAiOverlay .formatted-knowledge-content a {
  color: #4f37d6 !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
}

/* Import Data: bring upload/draft surfaces into the current light UI. */
.admin-aaa-body .aaa-import-hero-card,
.admin-aaa-body .import-hero-card {
  color: #111827 !important;
  background:
    radial-gradient(circle at 8% 0%, rgba(56, 124, 255, 0.16), transparent 32%),
    radial-gradient(circle at 96% 0%, rgba(124, 53, 255, 0.13), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(247,249,255,0.92)) !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 16px 42px rgba(31, 42, 74, 0.08) !important;
}

.admin-aaa-body .import-hero-card h2,
.admin-aaa-body .import-drafts-header h1,
.admin-aaa-body .drafts-title-group h1 {
  color: #111827 !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

.admin-aaa-body .import-hero-card p,
.admin-aaa-body .import-meta,
.admin-aaa-body .selected-draft-count,
.admin-aaa-body .file-drop-copy span,
.admin-aaa-body .draft-count-pill small {
  color: #526078 !important;
  -webkit-text-fill-color: #526078 !important;
}

.admin-aaa-body .file-drop-zone {
  border: 1px dashed #bfd0ea !important;
  background: rgba(255, 255, 255, 0.54) !important;
}

.admin-aaa-body .file-drop-copy strong,
.admin-aaa-body .selected-file-name {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

.admin-aaa-body .draft-count-pill {
  color: #111827 !important;
  background: #f6f8fc !important;
  border: 1px solid #d9e1ef !important;
}

.admin-aaa-body .draft-count-pill span {
  color: #ffffff !important;
  background: #6047e8 !important;
  border: 1px solid rgba(96, 71, 232, 0.22) !important;
}

.admin-aaa-body .import-bulk-toolbar,
.admin-aaa-body .aaa-import-bulk-toolbar {
  color: #111827 !important;
  background: rgba(250, 251, 255, 0.92) !important;
  border: 1px solid #d4dce8 !important;
}

/* Help & Support: remove light-on-light text and align cards with the current theme. */
.admin-aaa-body .support-mode-switch {
  max-width: 980px !important;
}

.admin-aaa-body .support-mode-card {
  min-height: 122px !important;
  color: #111827 !important;
  background: rgba(250, 251, 255, 0.92) !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.06) !important;
  text-shadow: none !important;
}

.admin-aaa-body .support-mode-card span {
  color: #687386 !important;
  font-weight: 600 !important;
}

.admin-aaa-body .support-mode-card strong {
  color: #111827 !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

.admin-aaa-body .support-mode-card.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #2f82ff 0%, #6b4ee6 100%) !important;
  border-color: rgba(107, 78, 230, 0.35) !important;
  box-shadow: 0 14px 32px rgba(96, 71, 232, 0.22) !important;
}

.admin-aaa-body .support-mode-card.active span,
.admin-aaa-body .support-mode-card.active strong {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.admin-aaa-body .support-tab-panel,
.admin-aaa-body .support-tab-panel.aaa-analytics-panel,
.admin-aaa-body .support-tab-panel.analytics-panel {
  color: #111827 !important;
  background: rgba(250, 251, 255, 0.92) !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.06) !important;
}

.admin-aaa-body .support-tab-panel h2,
.admin-aaa-body .support-faq-card summary {
  color: #111827 !important;
  font-weight: 700 !important;
}

.admin-aaa-body .support-tab-panel p,
.admin-aaa-body .support-faq-card p,
.admin-aaa-body .support-snapshot-box span {
  color: #526078 !important;
}

.admin-aaa-body .support-faq-card {
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 8px 18px rgba(31, 42, 74, 0.045) !important;
}

.admin-aaa-body .support-faq-card:nth-child(even) {
  background: #f7f9fd !important;
}

.admin-aaa-body .support-snapshot-box {
  color: #111827 !important;
  background: #f7f9fd !important;
  border: 1px solid #d4dce8 !important;
}

/* Duplicate Detection: scan controls, counts, and action colors. */
.admin-aaa-body .aaa-duplicates-toolbar {
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) !important;
  align-items: end !important;
  gap: 18px !important;
  padding: 20px !important;
  border: 1px solid #d4dce8 !important;
  border-radius: 20px !important;
  background: rgba(250, 251, 255, 0.90) !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.055) !important;
}

.admin-aaa-body .aaa-duplicates-toolbar .aaa-view-summary {
  display: grid !important;
  grid-template-columns: max-content max-content !important;
  align-items: center !important;
  gap: 12px !important;
  color: #111827 !important;
  white-space: nowrap !important;
}

.admin-aaa-body .aaa-duplicates-toolbar .aaa-view-summary strong {
  color: #111827 !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
}

.admin-aaa-body #duplicateStatus.aaa-view-count,
.admin-aaa-body #duplicateStatus {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 34px !important;
  padding: 6px 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  line-height: 1.15 !important;
  color: #6047e8 !important;
  background: #eee8ff !important;
  border: 1px solid #d9ceff !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-duplicate-settings-row {
  margin: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: end !important;
  gap: 14px !important;
}

.admin-aaa-body .aaa-duplicate-setting {
  min-width: 240px !important;
  color: #344054 !important;
}

.admin-aaa-body .aaa-duplicate-setting span {
  color: #526078 !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-duplicate-setting select {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 8px 20px rgba(31, 42, 74, 0.05) !important;
}

.admin-aaa-body .aaa-duplicate-setting select option {
  color: #111827 !important;
  background: #ffffff !important;
}

.admin-aaa-body .aaa-duplicate-header-buttons .primary-btn,
.admin-aaa-body #runDuplicateCheckBtn,
.admin-aaa-body .aaa-merge-review-btn,
.admin-aaa-body .aaa-merge-choice-row [data-choice="combine_both"].primary-btn {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: linear-gradient(135deg, #6b4ee6 0%, #6047e8 100%) !important;
  border: 1px solid rgba(96, 71, 232, 0.35) !important;
  box-shadow: 0 14px 30px rgba(96, 71, 232, 0.22) !important;
}

.admin-aaa-body .aaa-merge-review-btn strong,
.admin-aaa-body .aaa-merge-review-btn span,
.admin-aaa-body .aaa-merge-choice-row [data-choice="combine_both"].primary-btn,
.admin-aaa-body .aaa-merge-choice-row [data-choice="combine_both"].primary-btn * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.admin-aaa-body .aaa-keep-a-btn,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_a"] {
  color: #184a8a !important;
  -webkit-text-fill-color: #184a8a !important;
  background: linear-gradient(135deg, rgba(64, 122, 214, 0.18), #ffffff 76%) !important;
  border: 1px solid rgba(64, 122, 214, 0.42) !important;
  box-shadow: 0 10px 22px rgba(64, 122, 214, 0.08) !important;
}

.admin-aaa-body .aaa-keep-b-btn,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_b"] {
  color: #4f37d6 !important;
  -webkit-text-fill-color: #4f37d6 !important;
  background: linear-gradient(135deg, rgba(118, 82, 224, 0.18), #ffffff 76%) !important;
  border: 1px solid rgba(118, 82, 224, 0.42) !important;
  box-shadow: 0 10px 22px rgba(118, 82, 224, 0.08) !important;
}

.admin-aaa-body .aaa-keep-a-btn strong,
.admin-aaa-body .aaa-keep-a-btn span,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_a"] *,
.admin-aaa-body .aaa-keep-b-btn strong,
.admin-aaa-body .aaa-keep-b-btn span,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_b"] * {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

.admin-aaa-body .aaa-dismiss-match-btn {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-auto-merge-btn,
.admin-aaa-body .aaa-auto-merge-btn * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

@media (max-width: 1020px) {
  .admin-aaa-body .aaa-duplicates-toolbar {
    grid-template-columns: 1fr !important;
  }

  .admin-aaa-body .aaa-duplicates-toolbar .aaa-view-summary {
    justify-content: start !important;
  }
}

@media (max-width: 640px) {
  .admin-aaa-body .aaa-duplicates-toolbar .aaa-view-summary {
    grid-template-columns: 1fr !important;
    white-space: normal !important;
  }

  .admin-aaa-body #duplicateStatus {
    justify-self: start !important;
  }

  .admin-aaa-body .aaa-duplicate-setting {
    min-width: 100% !important;
  }
}

/* =========================================================
   FINAL FIX: Import page, duplicate merge modal, and billing time estimate
   ========================================================= */

/* Import Data page: match the current light UI and avoid washed-out text. */
.admin-aaa-body .import-cache-control {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 12px;
  color: #26344d;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #d4ddea;
  border-radius: 12px;
  cursor: pointer;
}

.admin-aaa-body .import-cache-control input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: #6848e8;
}

.admin-aaa-body .import-cache-control span {
  display: grid;
  gap: 2px;
}

.admin-aaa-body .import-cache-control b {
  color: #172033;
  font-size: 0.86rem;
}

.admin-aaa-body .import-cache-control small {
  color: #5b6880;
  line-height: 1.4;
}

.admin-aaa-body .aaa-import-hero-card,
.admin-aaa-body .import-hero-card {
  color: #111827 !important;
  background:
    radial-gradient(circle at 8% 0%, rgba(56, 124, 255, 0.10), transparent 32%),
    radial-gradient(circle at 96% 0%, rgba(124, 53, 255, 0.10), transparent 34%),
    linear-gradient(135deg, #fbfcff 0%, #f7f9fe 100%) !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 16px 42px rgba(31, 42, 74, 0.075) !important;
}

.admin-aaa-body .import-icon {
  color: #ffffff !important;
  background: linear-gradient(135deg, #2f82ff, #6848e8) !important;
  box-shadow: 0 12px 26px rgba(96, 71, 232, 0.20) !important;
}

.admin-aaa-body .import-hero-card h2,
.admin-aaa-body .import-drafts-header h1,
.admin-aaa-body .drafts-title-group h1 {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

.admin-aaa-body .import-hero-card p,
.admin-aaa-body .import-meta,
.admin-aaa-body .selected-draft-count,
.admin-aaa-body .file-drop-copy span,
.admin-aaa-body .draft-count-pill small,
.admin-aaa-body .import-field .field-label,
.admin-aaa-body .import-action-row .status-message {
  color: #526078 !important;
  -webkit-text-fill-color: #526078 !important;
  font-weight: 500 !important;
}

.admin-aaa-body .import-field input,
.admin-aaa-body .import-field select,
.admin-aaa-body #importCategory,
.admin-aaa-body #importScope {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  color-scheme: light !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 8px 20px rgba(31, 42, 74, 0.05) !important;
  font-weight: 500 !important;
}

.admin-aaa-body .file-drop-zone {
  border: 1px dashed #bfd0ea !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.78), rgba(248,250,255,0.78)) !important;
}

.admin-aaa-body .file-drop-copy strong,
.admin-aaa-body .selected-file-name {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 700 !important;
}

.admin-aaa-body .browse-file-btn {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: linear-gradient(135deg, #2f82ff 0%, #7048e8 100%) !important;
  border: 1px solid rgba(96, 71, 232, 0.30) !important;
  box-shadow: 0 12px 26px rgba(96, 71, 232, 0.18) !important;
}

.admin-aaa-body .draft-count-pill {
  color: #111827 !important;
  background: #f6f8fc !important;
  border: 1px solid #d9e1ef !important;
}

.admin-aaa-body .draft-count-pill span {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #6047e8 !important;
}

.admin-aaa-body .import-bulk-toolbar,
.admin-aaa-body .aaa-import-bulk-toolbar {
  color: #111827 !important;
  background: rgba(250, 251, 255, 0.94) !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.06) !important;
}

.admin-aaa-body .import-drafts-list .import-draft-card,
.admin-aaa-body .knowledge-grid .import-draft-card {
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 12px 30px rgba(31, 42, 74, 0.055) !important;
}

.admin-aaa-body .import-drafts-list .import-draft-card:nth-child(even) {
  background: #f8faff !important;
}

.admin-aaa-body .import-draft-card .card-title,
.admin-aaa-body .import-draft-card .draft-select-wrap,
.admin-aaa-body .import-draft-card .card-content {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 500 !important;
}

.admin-aaa-body .import-draft-card .card-title {
  font-weight: 700 !important;
}

.admin-aaa-body .import-draft-card .import-draft-content {
  color: #344054 !important;
  -webkit-text-fill-color: #344054 !important;
}

.admin-aaa-body .import-draft-card .status-badge.status-inactive,
.admin-aaa-body .import-draft-card .category-badge {
  color: #6047e8 !important;
  background: #f0ecff !important;
  border: 1px solid #d9ceff !important;
  box-shadow: none !important;
}

/* Import prompt windows: light modal shell, readable fields, current button system. */
.admin-aaa-body .aaa-draft-editor-panel,
.admin-aaa-body .draft-editor-panel {
  z-index: 5200 !important;
  background: rgba(15, 23, 42, 0.42) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.admin-aaa-body .aaa-draft-editor-panel .panel-shell,
.admin-aaa-body .draft-editor-panel .panel-shell {
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
  border-radius: 22px !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24) !important;
}

.admin-aaa-body .aaa-draft-editor-panel .panel-header,
.admin-aaa-body .draft-editor-panel .panel-header {
  background: #fbfcff !important;
  border-bottom: 1px solid #d4dce8 !important;
}

.admin-aaa-body .aaa-draft-editor-panel .panel-header h2,
.admin-aaa-body .draft-editor-panel .panel-header h2 {
  color: #111827 !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-draft-editor-panel .field-label,
.admin-aaa-body .draft-editor-panel .field-label,
.admin-aaa-body .aaa-draft-editor-panel .status-message,
.admin-aaa-body .draft-editor-panel .status-message {
  color: #526078 !important;
  -webkit-text-fill-color: #526078 !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-draft-editor-panel input,
.admin-aaa-body .aaa-draft-editor-panel textarea,
.admin-aaa-body .draft-editor-panel input,
.admin-aaa-body .draft-editor-panel textarea {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  color-scheme: light !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}

.admin-aaa-body .aaa-draft-editor-panel textarea,
.admin-aaa-body .draft-editor-panel textarea {
  line-height: 1.58 !important;
}

.admin-aaa-body .aaa-draft-editor-panel .icon-btn,
.admin-aaa-body .draft-editor-panel .icon-btn {
  color: #344054 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
}

.admin-aaa-body .aaa-draft-editor-panel .approve-wide-btn,
.admin-aaa-body .draft-editor-panel .approve-wide-btn,
.admin-aaa-body #saveDraftEditBtn,
.admin-aaa-body #applyAiImproveBtn,
.admin-aaa-body #mergeDuplicateDraftBtn {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #12b981 !important;
  border: 1px solid #10a673 !important;
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.18) !important;
}

/* Import AI/duplicate overlays and import duplicate report overlay. */
.admin-aaa-body #aiImproveOverlay .duplicate-modal,
.admin-aaa-body #duplicateOverlay .duplicate-modal,
.admin-aaa-body #importDuplicateResultsOverlay .duplicate-modal {
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24) !important;
}

.admin-aaa-body #aiImproveOverlay .duplicate-header,
.admin-aaa-body #duplicateOverlay .duplicate-header,
.admin-aaa-body #importDuplicateResultsOverlay .duplicate-header,
.admin-aaa-body #aiImproveOverlay .duplicate-actions,
.admin-aaa-body #duplicateOverlay .duplicate-actions,
.admin-aaa-body #importDuplicateResultsOverlay .duplicate-actions {
  background: #fbfcff !important;
  border-color: #d4dce8 !important;
}

.admin-aaa-body #aiImproveOverlay .duplicate-header h2,
.admin-aaa-body #duplicateOverlay .duplicate-header h2,
.admin-aaa-body #importDuplicateResultsOverlay .duplicate-header h2,
.admin-aaa-body #aiImproveOverlay .duplicate-column h3,
.admin-aaa-body #duplicateOverlay .duplicate-column h3,
.admin-aaa-body #importDuplicateResultsOverlay h3 {
  color: #111827 !important;
  font-weight: 700 !important;
}

.admin-aaa-body #aiImproveOverlay .duplicate-header p,
.admin-aaa-body #duplicateOverlay .duplicate-header p,
.admin-aaa-body #importDuplicateResultsOverlay .duplicate-header p,
.admin-aaa-body #aiImproveOverlay .duplicate-meta,
.admin-aaa-body #duplicateOverlay .duplicate-meta,
.admin-aaa-body #importDuplicateResultsOverlay .duplicate-meta {
  color: #526078 !important;
}

.admin-aaa-body #aiImproveOverlay .duplicate-column,
.admin-aaa-body #duplicateOverlay .duplicate-column {
  color: #111827 !important;
  border-color: #d4dce8 !important;
  background: linear-gradient(135deg, rgba(64, 122, 214, 0.10), #ffffff 70%) !important;
}

.admin-aaa-body #aiImproveOverlay .duplicate-column:last-child,
.admin-aaa-body #duplicateOverlay .duplicate-column:last-child {
  background: linear-gradient(135deg, rgba(118, 82, 224, 0.12), #ffffff 70%) !important;
}

.admin-aaa-body #aiImproveOverlay .duplicate-content,
.admin-aaa-body #duplicateOverlay .duplicate-content,
.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-result-entry p {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  background: rgba(255,255,255,0.72) !important;
  border: 1px solid #d9e1ef !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  font-weight: 400 !important;
}

.admin-aaa-body #aiImproveOverlay .topic-label,
.admin-aaa-body #duplicateOverlay .topic-label {
  color: #6047e8 !important;
  -webkit-text-fill-color: #6047e8 !important;
  background: #f0ecff !important;
  border: 1px solid #d9ceff !important;
  border-radius: 9px !important;
  padding: 4px 8px !important;
  font-weight: 700 !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-result-card {
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 10px 24px rgba(31,42,74,0.055) !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-result-entry {
  color: #111827 !important;
  background: #f8faff !important;
  border: 1px solid #d9e1ef !important;
}

/* Duplicate Detection page: button and scan pill refinement. */
.admin-aaa-body .aaa-duplicates-toolbar .aaa-view-summary {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: max-content !important;
}

.admin-aaa-body #duplicateStatus,
.admin-aaa-body #duplicateStatus.aaa-view-count {
  display: inline-flex !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  text-align: left !important;
  padding: 7px 14px !important;
}

.admin-aaa-body #runDuplicateCheckBtn,
.admin-aaa-body .aaa-duplicate-header-buttons .primary-btn,
.admin-aaa-body .aaa-merge-review-btn,
.admin-aaa-body .aaa-merge-choice-row [data-choice="combine_both"] {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: linear-gradient(135deg, #6b4ee6 0%, #6047e8 100%) !important;
  border: 1px solid rgba(96, 71, 232, 0.35) !important;
  box-shadow: 0 14px 30px rgba(96, 71, 232, 0.22) !important;
}

.admin-aaa-body .aaa-keep-a-btn,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_a"] {
  color: #174f94 !important;
  -webkit-text-fill-color: #174f94 !important;
  background: linear-gradient(135deg, rgba(64, 122, 214, 0.22), #ffffff 74%) !important;
  border: 1px solid rgba(64, 122, 214, 0.48) !important;
  box-shadow: 0 10px 22px rgba(64, 122, 214, 0.10) !important;
}

.admin-aaa-body .aaa-keep-b-btn,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_b"] {
  color: #5139d8 !important;
  -webkit-text-fill-color: #5139d8 !important;
  background: linear-gradient(135deg, rgba(118, 82, 224, 0.22), #ffffff 74%) !important;
  border: 1px solid rgba(118, 82, 224, 0.50) !important;
  box-shadow: 0 10px 22px rgba(118, 82, 224, 0.10) !important;
}

.admin-aaa-body .aaa-keep-a-btn *,
.admin-aaa-body .aaa-keep-b-btn *,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_a"] *,
.admin-aaa-body .aaa-merge-choice-row [data-choice="keep_b"] * {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

/* Merge duplicate records prompt: light shell with blue/purple comparison cards. */
.admin-aaa-body .aaa-merge-modal-overlay {
  background: rgba(15, 23, 42, 0.48) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 6400 !important;
}

.admin-aaa-body .aaa-merge-modal {
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
  border-radius: 22px !important;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.26) !important;
}

.admin-aaa-body .aaa-merge-header,
.admin-aaa-body .aaa-merge-actions {
  background: #fbfcff !important;
  border-color: #d4dce8 !important;
}

.admin-aaa-body .aaa-merge-header h2,
.admin-aaa-body .aaa-merge-preview-heading strong,
.admin-aaa-body .aaa-merge-source-card h3 {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 700 !important;
}

.admin-aaa-body .aaa-merge-header p,
.admin-aaa-body .aaa-merge-source-card .duplicate-meta,
.admin-aaa-body .aaa-merge-preview-heading span,
.admin-aaa-body .aaa-merge-actions span {
  color: #526078 !important;
  -webkit-text-fill-color: #526078 !important;
}

.admin-aaa-body .aaa-merge-source-card,
.admin-aaa-body .aaa-merge-preview {
  color: #111827 !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 10px 24px rgba(31, 42, 74, 0.055) !important;
}

.admin-aaa-body .aaa-merge-source-card:first-child {
  background: linear-gradient(135deg, rgba(64, 122, 214, 0.18), #ffffff 74%) !important;
  border-color: rgba(64, 122, 214, 0.42) !important;
}

.admin-aaa-body .aaa-merge-source-card:nth-child(2) {
  background: linear-gradient(135deg, rgba(118, 82, 224, 0.18), #ffffff 74%) !important;
  border-color: rgba(118, 82, 224, 0.42) !important;
}

.admin-aaa-body .aaa-merge-source-card:first-child small {
  color: #174f94 !important;
  background: rgba(64, 122, 214, 0.14) !important;
  border-color: rgba(64, 122, 214, 0.34) !important;
}

.admin-aaa-body .aaa-merge-source-card:nth-child(2) small {
  color: #5139d8 !important;
  background: rgba(118, 82, 224, 0.14) !important;
  border-color: rgba(118, 82, 224, 0.34) !important;
}

.admin-aaa-body .aaa-merge-source-card .duplicate-content {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  background: rgba(255,255,255,0.72) !important;
  border: 1px solid #d9e1ef !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  font-weight: 400 !important;
}

.admin-aaa-body .aaa-merge-preview {
  background: #f8faff !important;
}

.admin-aaa-body .aaa-merge-preview label {
  color: #344054 !important;
  font-weight: 600 !important;
}

.admin-aaa-body .aaa-merge-preview input,
.admin-aaa-body .aaa-merge-preview textarea {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  color-scheme: light !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}

.admin-aaa-body .aaa-merge-choice-row {
  background: #f6f8fc !important;
  border-color: #d4dce8 !important;
}

.admin-aaa-body .aaa-merge-choice-row .secondary-btn,
.admin-aaa-body .aaa-merge-header .secondary-btn,
.admin-aaa-body .aaa-merge-actions .secondary-btn {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
}

.admin-aaa-body .aaa-merge-choice-row .is-active-choice {
  outline: 3px solid rgba(96, 71, 232, 0.16) !important;
  transform: none !important;
}

.admin-aaa-body .aaa-smart-merge-loading {
  background: rgba(248, 250, 255, 0.82) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

.admin-aaa-body .aaa-smart-merge-loading-card {
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
  box-shadow: 0 18px 44px rgba(31, 42, 74, 0.14) !important;
}

/* Billing & Usage: editable minutes-per-question control. */
.admin-aaa-body .time-saved-summary-card .time-saved-summary-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-aaa-body .time-estimate-input-wrap {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid #cfd7e8;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(31, 42, 74, 0.045);
}

.admin-aaa-body .time-estimate-input-wrap input {
  width: 76px !important;
  min-height: 30px !important;
  padding: 0 !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-align: right;
  font-weight: 600 !important;
}

.admin-aaa-body .time-estimate-input-wrap small {
  color: #65708a !important;
  font-style: normal;
  font-weight: 600 !important;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .admin-aaa-body .aaa-merge-compare-grid,
  .admin-aaa-body .duplicate-body {
    grid-template-columns: 1fr !important;
  }

  .admin-aaa-body .aaa-duplicates-toolbar .aaa-view-summary {
    min-width: 0 !important;
    flex-wrap: wrap !important;
  }
}

/* =========================================================
   IMPORT BUTTON TONE REFINEMENT
   Softer action colors for the light UI.
   ========================================================= */
.admin-aaa-body .aaa-draft-editor-panel #saveDraftEditBtn,
.admin-aaa-body .draft-editor-panel #saveDraftEditBtn {
  color: #1d4f91 !important;
  -webkit-text-fill-color: #1d4f91 !important;
  background: linear-gradient(180deg, #f4f9ff 0%, #e8f2ff 100%) !important;
  border: 1px solid #bdd6f6 !important;
  box-shadow: 0 10px 22px rgba(45, 108, 190, 0.10) !important;
  text-shadow: none !important;
}

.admin-aaa-body .aaa-draft-editor-panel #saveDraftEditBtn:hover,
.admin-aaa-body .draft-editor-panel #saveDraftEditBtn:hover {
  color: #17457f !important;
  -webkit-text-fill-color: #17457f !important;
  background: linear-gradient(180deg, #eef6ff 0%, #dfeeff 100%) !important;
  border-color: #a8c9f0 !important;
  box-shadow: 0 12px 24px rgba(45, 108, 190, 0.13) !important;
}

.admin-aaa-body .aaa-draft-editor-panel #approveFromEditorBtn,
.admin-aaa-body .draft-editor-panel #approveFromEditorBtn,
.admin-aaa-body .aaa-import-bulk-toolbar #approveSelectedDraftsBtn,
.admin-aaa-body .import-bulk-toolbar #approveSelectedDraftsBtn,
.admin-aaa-body .import-drafts-list .approve-draft-btn,
.admin-aaa-body .knowledge-grid .import-draft-card .approve-draft-btn {
  color: #087a55 !important;
  -webkit-text-fill-color: #087a55 !important;
  background: linear-gradient(180deg, #f0fff8 0%, #e2f8ee 100%) !important;
  border: 1px solid #afe6d0 !important;
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.10) !important;
  text-shadow: none !important;
}

.admin-aaa-body .aaa-draft-editor-panel #approveFromEditorBtn:hover,
.admin-aaa-body .draft-editor-panel #approveFromEditorBtn:hover,
.admin-aaa-body .aaa-import-bulk-toolbar #approveSelectedDraftsBtn:hover,
.admin-aaa-body .import-bulk-toolbar #approveSelectedDraftsBtn:hover,
.admin-aaa-body .import-drafts-list .approve-draft-btn:hover,
.admin-aaa-body .knowledge-grid .import-draft-card .approve-draft-btn:hover {
  color: #066342 !important;
  -webkit-text-fill-color: #066342 !important;
  background: linear-gradient(180deg, #e9fff5 0%, #d7f5e7 100%) !important;
  border-color: #91d9bb !important;
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.13) !important;
}

.admin-aaa-body .aaa-draft-editor-panel #improveDraftBtn,
.admin-aaa-body .draft-editor-panel #improveDraftBtn,
.admin-aaa-body .aaa-import-bulk-toolbar #improveSelectedDraftsBtn,
.admin-aaa-body .import-bulk-toolbar #improveSelectedDraftsBtn,
.admin-aaa-body .import-drafts-list .improve-draft-btn,
.admin-aaa-body .knowledge-grid .import-draft-card .improve-draft-btn {
  color: #5146c7 !important;
  -webkit-text-fill-color: #5146c7 !important;
  background: linear-gradient(135deg, #eff6ff 0%, #f3efff 100%) !important;
  border: 1px solid #cfd7ff !important;
  box-shadow: 0 10px 22px rgba(96, 71, 232, 0.10) !important;
  text-shadow: none !important;
  filter: none !important;
}

.admin-aaa-body .aaa-draft-editor-panel #improveDraftBtn:hover,
.admin-aaa-body .draft-editor-panel #improveDraftBtn:hover,
.admin-aaa-body .aaa-import-bulk-toolbar #improveSelectedDraftsBtn:hover,
.admin-aaa-body .import-bulk-toolbar #improveSelectedDraftsBtn:hover,
.admin-aaa-body .import-drafts-list .improve-draft-btn:hover,
.admin-aaa-body .knowledge-grid .import-draft-card .improve-draft-btn:hover {
  color: #4338b7 !important;
  -webkit-text-fill-color: #4338b7 !important;
  background: linear-gradient(135deg, #e7f1ff 0%, #ece8ff 100%) !important;
  border-color: #bdc5fb !important;
  box-shadow: 0 12px 24px rgba(96, 71, 232, 0.13) !important;
  filter: none !important;
}

.admin-aaa-body .aaa-import-bulk-toolbar #ignoreSelectedDraftsBtn,
.admin-aaa-body .import-bulk-toolbar #ignoreSelectedDraftsBtn,
.admin-aaa-body .aaa-import-bulk-toolbar #clearAllDraftsBtn,
.admin-aaa-body .import-bulk-toolbar #clearAllDraftsBtn,
.admin-aaa-body .import-drafts-list .ignore-draft-btn,
.admin-aaa-body .knowledge-grid .import-draft-card .ignore-draft-btn {
  color: #b42318 !important;
  -webkit-text-fill-color: #b42318 !important;
  background: linear-gradient(180deg, #fff8f8 0%, #fff0f1 100%) !important;
  border: 1px solid #f3c0c5 !important;
  box-shadow: 0 10px 22px rgba(180, 35, 24, 0.08) !important;
  text-shadow: none !important;
}

.admin-aaa-body .aaa-import-bulk-toolbar #ignoreSelectedDraftsBtn:hover,
.admin-aaa-body .import-bulk-toolbar #ignoreSelectedDraftsBtn:hover,
.admin-aaa-body .aaa-import-bulk-toolbar #clearAllDraftsBtn:hover,
.admin-aaa-body .import-bulk-toolbar #clearAllDraftsBtn:hover,
.admin-aaa-body .import-drafts-list .ignore-draft-btn:hover,
.admin-aaa-body .knowledge-grid .import-draft-card .ignore-draft-btn:hover {
  color: #981b12 !important;
  -webkit-text-fill-color: #981b12 !important;
  background: linear-gradient(180deg, #fff4f4 0%, #ffe8ea 100%) !important;
  border-color: #eba8ae !important;
  box-shadow: 0 12px 24px rgba(180, 35, 24, 0.11) !important;
}

.admin-aaa-body .aaa-import-bulk-toolbar .bulk-btn,
.admin-aaa-body .import-bulk-toolbar .bulk-btn,
.admin-aaa-body .aaa-draft-editor-panel .panel-actions button,
.admin-aaa-body .draft-editor-panel .panel-actions button,
.admin-aaa-body .aaa-draft-editor-panel .approve-wide-btn,
.admin-aaa-body .draft-editor-panel .approve-wide-btn {
  font-weight: 650 !important;
}

.admin-aaa-body .aaa-import-bulk-toolbar button:disabled,
.admin-aaa-body .import-bulk-toolbar button:disabled,
.admin-aaa-body .aaa-draft-editor-panel button:disabled,
.admin-aaa-body .draft-editor-panel button:disabled {
  color: #9aa4b5 !important;
  -webkit-text-fill-color: #9aa4b5 !important;
  background: #f4f6fb !important;
  border-color: #d9e1ef !important;
  box-shadow: none !important;
}

/* =========================================================
   IMPORT DATA FINAL LIGHT CONTRAST PASS
   Keeps the current light UI while removing remaining
   light-on-light text from the import page and draft cards.
   ========================================================= */
.admin-aaa-body .aaa-import-hero-card,
.admin-aaa-body .import-hero-card {
  color: #111827 !important;
  background:
    radial-gradient(circle at 8% 10%, rgba(47, 127, 255, 0.16), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(124, 88, 255, 0.14), transparent 32%),
    linear-gradient(135deg, #f8fbff 0%, #f2f6ff 52%, #f7f3ff 100%) !important;
  border: 1px solid #cfd8ea !important;
  box-shadow: 0 18px 46px rgba(31, 42, 74, 0.10) !important;
}

.admin-aaa-body .import-hero-card h2,
.admin-aaa-body .aaa-import-hero-card h2,
.admin-aaa-body .import-hero-card p,
.admin-aaa-body .aaa-import-hero-card p,
.admin-aaa-body .import-hero-card .field-label,
.admin-aaa-body .aaa-import-hero-card .field-label,
.admin-aaa-body .import-action-row .status-message {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

.admin-aaa-body .import-hero-card p,
.admin-aaa-body .aaa-import-hero-card p,
.admin-aaa-body .import-action-row .status-message {
  color: #4d5b73 !important;
  -webkit-text-fill-color: #4d5b73 !important;
}

.admin-aaa-body .import-icon {
  color: #ffffff !important;
  background: linear-gradient(135deg, #2f7fff 0%, #6b4ee6 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  box-shadow: 0 12px 24px rgba(80, 94, 220, 0.20) !important;
}

.admin-aaa-body .import-field input,
.admin-aaa-body .import-field select,
.admin-aaa-body .aaa-import-hero-card input,
.admin-aaa-body .aaa-import-hero-card select {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 8px 20px rgba(31, 42, 74, 0.055) !important;
  color-scheme: light !important;
}

.admin-aaa-body .import-field input::placeholder,
.admin-aaa-body .aaa-import-hero-card input::placeholder {
  color: #677489 !important;
  -webkit-text-fill-color: #677489 !important;
}

.admin-aaa-body .file-drop-zone {
  color: #111827 !important;
  background: rgba(255, 255, 255, 0.54) !important;
  border: 1px dashed #acc7ee !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34) !important;
}

.admin-aaa-body .file-drop-copy strong,
.admin-aaa-body .file-drop-copy span,
.admin-aaa-body .selected-file-name {
  -webkit-text-fill-color: initial !important;
}

.admin-aaa-body .file-drop-copy strong {
  color: #111827 !important;
  font-weight: 650 !important;
}

.admin-aaa-body .file-drop-copy span {
  color: #526078 !important;
}

.admin-aaa-body .selected-file-name {
  color: #344054 !important;
  font-weight: 600 !important;
}

.admin-aaa-body .import-drafts-header h1,
.admin-aaa-body .drafts-title-group h1 {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

.admin-aaa-body .import-drafts-header p,
.admin-aaa-body .drafts-title-row + p {
  color: #4d5b73 !important;
  -webkit-text-fill-color: #4d5b73 !important;
}

.admin-aaa-body .refresh-icon-btn {
  color: #2f6edb !important;
  -webkit-text-fill-color: #2f6edb !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 8px 18px rgba(31, 42, 74, 0.06) !important;
}

.admin-aaa-body .draft-count-pill {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  background: #f5f7fc !important;
  border: 1px solid #d8e0ef !important;
  box-shadow: 0 10px 22px rgba(31, 42, 74, 0.045) !important;
}

.admin-aaa-body .draft-count-pill span {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: linear-gradient(135deg, #4d7cff 0%, #6b4ee6 100%) !important;
}

.admin-aaa-body .draft-count-pill small,
.admin-aaa-body .selected-draft-count {
  color: #526078 !important;
  -webkit-text-fill-color: #526078 !important;
}

.admin-aaa-body .import-bulk-toolbar,
.admin-aaa-body .aaa-import-bulk-toolbar {
  color: #111827 !important;
  background: rgba(255, 255, 255, 0.78) !important;
  border: 1px solid #cfd8ea !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.08) !important;
}

.admin-aaa-body .import-bulk-toolbar .secondary-btn,
.admin-aaa-body .aaa-import-bulk-toolbar .secondary-btn,
.admin-aaa-body .import-bulk-toolbar .bulk-btn,
.admin-aaa-body .aaa-import-bulk-toolbar .bulk-btn {
  font-weight: 600 !important;
}

.admin-aaa-body .import-drafts-list,
.admin-aaa-body .knowledge-grid.import-drafts-list {
  color: #111827 !important;
}

.admin-aaa-body .import-drafts-list .import-draft-card,
.admin-aaa-body .knowledge-grid .import-draft-card {
  color: #111827 !important;
  background:
    radial-gradient(circle at 92% 8%, rgba(124, 88, 255, 0.055), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8faff 100%) !important;
  border: 1px solid #cfd8ea !important;
  box-shadow: 0 12px 28px rgba(31, 42, 74, 0.075) !important;
}

.admin-aaa-body .import-drafts-list .import-draft-card:nth-child(even),
.admin-aaa-body .knowledge-grid .import-draft-card:nth-child(even) {
  background:
    radial-gradient(circle at 92% 8%, rgba(47, 127, 255, 0.055), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f5f8fd 100%) !important;
}

.admin-aaa-body .import-draft-card .card-title,
.admin-aaa-body .import-draft-card h3,
.admin-aaa-body .import-draft-card .card-content,
.admin-aaa-body .import-draft-card .import-draft-content,
.admin-aaa-body .import-draft-card .import-meta,
.admin-aaa-body .import-draft-card .draft-select-wrap,
.admin-aaa-body .import-draft-card .draft-select-wrap span {
  -webkit-text-fill-color: initial !important;
}

.admin-aaa-body .import-draft-card .card-title,
.admin-aaa-body .import-draft-card h3 {
  color: #111827 !important;
  font-weight: 650 !important;
}

.admin-aaa-body .import-draft-card .import-meta {
  color: #526078 !important;
  font-weight: 500 !important;
}

.admin-aaa-body .import-draft-card .card-content,
.admin-aaa-body .import-draft-card .import-draft-content {
  color: #263247 !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
}

.admin-aaa-body .import-draft-card .draft-select-wrap {
  color: #344054 !important;
  font-weight: 600 !important;
}

.admin-aaa-body .import-draft-card .category-badge {
  color: #6047e8 !important;
  -webkit-text-fill-color: #6047e8 !important;
  background: #f0ecff !important;
  border: 1px solid #d7ceff !important;
  box-shadow: none !important;
}

.admin-aaa-body .import-draft-card .status-badge,
.admin-aaa-body .import-draft-card .status-inactive {
  color: #6047e8 !important;
  -webkit-text-fill-color: #6047e8 !important;
  background: #f2edff !important;
  border: 1px solid #d8ceff !important;
  box-shadow: none !important;
}

.admin-aaa-body .import-draft-card .card-divider {
  background: #dbe3f1 !important;
}

.admin-aaa-body .import-drafts-list .empty-state {
  color: #526078 !important;
  -webkit-text-fill-color: #526078 !important;
  background: rgba(255, 255, 255, 0.74) !important;
  border: 1px dashed #cbd5e1 !important;
}


/* =========================================================
   KNOWLEDGE MANAGER TOPIC ASSOCIATIONS TOGGLE
   ========================================================= */
.admin-aaa-body #associationPanel[hidden],
.admin-aaa-body .aaa-association-panel[hidden] {
  display: none !important;
}

.admin-aaa-body .aaa-topic-associations-toggle {
  height: 42px !important;
  min-width: 174px !important;
  padding: 0 18px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  color: #25304a !important;
  background: #ffffff !important;
  border: 1px solid #cfd8ea !important;
  box-shadow: 0 8px 18px rgba(31, 42, 74, 0.06) !important;
}

.admin-aaa-body .aaa-topic-associations-toggle:hover {
  color: #5038d2 !important;
  background: #f8f7ff !important;
  border-color: #cbc4f4 !important;
}

.admin-aaa-body .aaa-topic-associations-toggle.active {
  color: #5038d2 !important;
  background: #f1ecff !important;
  border-color: #cbc4f4 !important;
  box-shadow: 0 10px 22px rgba(98, 71, 232, 0.13) !important;
}

.admin-aaa-body .aaa-association-panel {
  animation: aaaAssociationPanelIn 0.18s ease both;
}

@keyframes aaaAssociationPanelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .admin-aaa-body .aaa-topic-associations-toggle,
  .admin-aaa-body .aaa-duplicate-check-btn {
    flex: 1 1 100%;
    min-width: 0 !important;
  }
}

/* =========================================================
   IMPORT DUPLICATE REVIEW OVERLAY
   Uses the same A/B blue-purple duplicate review system while
   keeping modal text visible and scrollable.
   ========================================================= */
.admin-aaa-body #importDuplicateResultsOverlay.open {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 22px !important;
  overflow: hidden !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-results-modal {
  width: min(1180px, calc(100vw - 44px)) !important;
  max-width: min(1180px, calc(100vw - 44px)) !important;
  height: min(92vh, 920px) !important;
  max-height: min(92vh, 920px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: 22px !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .duplicate-header,
.admin-aaa-body #importDuplicateResultsOverlay .duplicate-actions {
  flex: 0 0 auto !important;
  z-index: 2 !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-import-duplicate-status {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  padding: 0 22px !important;
  color: #526078 !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  background: #fbfcff !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-import-duplicate-status:not(:empty) {
  padding-top: 12px !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-results-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: auto !important;
  display: grid !important;
  gap: 18px !important;
  padding: 18px 22px !important;
  background: #f6f8fc !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-workspace {
  width: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: #ffffff !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-workspace-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px) !important;
  align-items: start !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-entry-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .duplicate-content {
  display: block !important;
  width: 100% !important;
  max-height: 250px !important;
  overflow: auto !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.55 !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions:has(.aaa-auto-merge-btn) {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions button {
  min-width: 0 !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions button strong,
.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions button span {
  white-space: normal !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-header-actions span {
  display: inline-flex !important;
  max-width: 260px !important;
  white-space: normal !important;
  line-height: 1.3 !important;
  text-align: right !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .empty-state {
  margin: 0 !important;
}

@media (max-width: 1060px) {
  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-workspace-grid,
  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-entry-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-analysis-panel {
    order: -1 !important;
  }
}

@media (max-width: 760px) {
  .admin-aaa-body #importDuplicateResultsOverlay.open {
    padding: 10px !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-results-modal {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-results-body {
    padding: 14px !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-workspace-header {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-header-actions {
    justify-content: flex-start !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-header-actions span {
    max-width: none !important;
    text-align: left !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions,
  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions:has(.aaa-auto-merge-btn) {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   IMPORT DUPLICATE REVIEW MODAL FINAL LAYOUT FIX
   Keeps the duplicate procedure inside the popup and prevents
   the A/B comparison cards from being clipped.
   ========================================================= */
.admin-aaa-body #importDuplicateResultsOverlay.open {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 22px !important;
  overflow: hidden !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-results-modal {
  width: min(1180px, calc(100vw - 44px)) !important;
  max-width: min(1180px, calc(100vw - 44px)) !important;
  height: min(88vh, 920px) !important;
  max-height: min(88vh, 920px) !important;
  min-height: min(680px, calc(100vh - 44px)) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  color: #111827 !important;
  background: #ffffff !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .duplicate-header,
.admin-aaa-body #importDuplicateResultsOverlay .aaa-import-duplicate-status,
.admin-aaa-body #importDuplicateResultsOverlay .duplicate-actions {
  flex: 0 0 auto !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-results-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  padding: 22px !important;
  background: #f6f8fc !important;
  scrollbar-gutter: stable !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-import-duplicate-card,
.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-workspace {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 0 0 auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  border: 1px solid #d4dce8 !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 12px 28px rgba(31,42,74,0.075) !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-workspace::before {
  display: none !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-workspace-header {
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 18px !important;
  padding: 20px 22px 16px !important;
  border-bottom: 1px solid #d9e1ef !important;
  background: linear-gradient(180deg, #ffffff, #fbfcff) !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-workspace-grid {
  position: relative !important;
  z-index: 1 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px) !important;
  align-items: stretch !important;
  gap: 16px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 16px !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-left-panel {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-entry-grid,
.admin-aaa-body #importDuplicateResultsOverlay .duplicate-body,
.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-review-body {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 14px !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .duplicate-column,
.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-review-column {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 18px !important;
  border-radius: 16px !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-entry-card-top {
  flex: 0 0 auto !important;
  min-width: 0 !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .duplicate-column h3,
.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-review-column h3 {
  flex: 0 0 auto !important;
  margin: 0 0 8px !important;
  line-height: 1.25 !important;
  overflow-wrap: anywhere !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .duplicate-meta {
  flex: 0 0 auto !important;
  margin-bottom: 10px !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .duplicate-content {
  flex: 1 1 auto !important;
  display: block !important;
  min-height: 160px !important;
  max-height: 300px !important;
  width: 100% !important;
  overflow: auto !important;
  padding: 14px !important;
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  background: rgba(255,255,255,0.76) !important;
  border: 1px solid #d9e1ef !important;
  border-radius: 14px !important;
  line-height: 1.55 !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-analysis-panel {
  display: block !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  align-self: stretch !important;
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
  border-radius: 16px !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions,
.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-action-row {
  flex: 0 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  padding: 14px 0 0 !important;
  margin: 0 !important;
  height: auto !important;
  overflow: visible !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions:has(.aaa-auto-merge-btn),
.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-action-row:has(.aaa-auto-merge-btn) {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions button {
  min-width: 0 !important;
  min-height: 58px !important;
  white-space: normal !important;
}

.admin-aaa-body #importDuplicateResultsOverlay .aaa-import-duplicate-footer {
  justify-content: flex-end !important;
  background: #ffffff !important;
  box-shadow: 0 -10px 26px rgba(31, 42, 74, 0.08) !important;
}

@media (max-width: 1100px) {
  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-workspace-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-analysis-panel {
    order: -1 !important;
  }
}

@media (max-width: 860px) {
  .admin-aaa-body #importDuplicateResultsOverlay.open {
    padding: 10px !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-results-modal {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    min-height: 0 !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-workspace-header {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-header-actions {
    justify-content: flex-start !important;
  }

  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-entry-grid,
  .admin-aaa-body #importDuplicateResultsOverlay .duplicate-body,
  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-review-body,
  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions,
  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-primary-actions:has(.aaa-auto-merge-btn),
  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-action-row,
  .admin-aaa-body #importDuplicateResultsOverlay .aaa-duplicate-action-row:has(.aaa-auto-merge-btn) {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   DUPLICATE DIFFERENCE HIGHLIGHTING
   Highlights unique content inside A/B duplicate comparisons
   without marking generally similar wording.
   ========================================================= */
.admin-aaa-body .duplicate-content.aaa-diff-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-aaa-body .aaa-diff-unique {
  display: inline;
  padding: 1px 3px;
  margin: 0 -1px;
  border-radius: 5px;
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.admin-aaa-body .aaa-diff-unique-a {
  background: rgba(37, 99, 235, 0.18);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18) inset;
}

.admin-aaa-body .aaa-diff-unique-b {
  background: rgba(109, 40, 217, 0.17);
  box-shadow: 0 0 0 1px rgba(109, 40, 217, 0.18) inset;
}

.admin-aaa-body .aaa-unique-segment-list {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.admin-aaa-body .aaa-unique-segment-list strong {
  display: block;
  margin-bottom: 7px;
  color: #111827;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-aaa-body .aaa-unique-segment-list ul {
  margin: 0;
  padding-left: 18px;
}

.admin-aaa-body .aaa-unique-segment-list li + li {
  margin-top: 6px;
}

.admin-aaa-body .aaa-unique-list-a {
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.07);
}

.admin-aaa-body .aaa-unique-list-b {
  border: 1px solid rgba(109, 40, 217, 0.22);
  background: rgba(109, 40, 217, 0.07);
}


/* Duplicate Detection helper note: explains blue/purple unique text highlights. */
.admin-aaa-body .aaa-duplicate-highlight-note {
  margin: -2px 0 10px;
  max-width: 760px;
  color: #546078;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
}

.admin-aaa-body .aaa-duplicate-workspace-header .aaa-duplicate-highlight-note + .aaa-duplicate-headline-row {
  margin-top: 0;
}

/* =========================================================
   IMPORT PROGRESS ESTIMATE PANEL
   Client-side staged progress for long document imports.
   ========================================================= */
.admin-aaa-body .import-progress-panel[hidden] {
  display: none !important;
}

.admin-aaa-body .import-progress-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #c9d7f2;
  border-radius: 20px;
  background:
    radial-gradient(circle at 0% 0%, rgba(47, 127, 255, 0.12), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(111, 76, 230, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.94));
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.08);
  color: #111827;
}

.admin-aaa-body .import-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.admin-aaa-body .import-progress-kicker {
  margin-bottom: 5px;
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-aaa-body .import-progress-head h3 {
  margin: 0;
  color: #111827;
  font-size: 1.04rem;
  font-weight: 800;
}

.admin-aaa-body .import-progress-head p {
  margin: 5px 0 0;
  color: #526078 !important;
  -webkit-text-fill-color: #526078 !important;
  font-size: 0.92rem;
  line-height: 1.45;
}

.admin-aaa-body .import-progress-percent {
  min-width: 68px;
  padding: 9px 12px;
  border: 1px solid #d8d0ff;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef5ff, #f3efff);
  color: #5534d8;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
}

.admin-aaa-body .import-progress-bar {
  position: relative;
  height: 12px;
  margin: 16px 0 14px;
  overflow: hidden;
  border: 1px solid #d4def4;
  border-radius: 999px;
  background: #edf2fb;
}

.admin-aaa-body .import-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f7fff 0%, #6b4ee6 100%);
  box-shadow: 0 4px 12px rgba(80, 94, 220, 0.22);
  transition: width 0.45s ease;
}

.admin-aaa-body .import-progress-current {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-aaa-body .import-progress-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #bcd4ff;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1f5fbf;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.admin-aaa-body .import-progress-current strong {
  color: #111827;
  font-size: 0.94rem;
  font-weight: 800;
}

.admin-aaa-body .import-progress-meta-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.admin-aaa-body .import-progress-meta-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #d8e1f2;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
}

.admin-aaa-body .import-progress-meta-grid span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-aaa-body .import-progress-meta-grid strong {
  display: block;
  overflow: hidden;
  color: #111827;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-aaa-body .import-progress-log {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #d9e2f1;
  border-radius: 15px;
  background: rgba(248, 250, 255, 0.84);
  color: #40516d;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

/* Import guidance and batch-result rollouts. */
.admin-aaa-body .import-subtitle-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.admin-aaa-body .import-subtitle-row p {
  margin: 0;
}

.admin-aaa-body .import-info-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: -6px;
  padding: 0;
  border: 1px solid #bfc9e2;
  border-radius: 999px;
  color: #4f3bd1;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(57, 47, 139, 0.1);
  font: 800 0.82rem/1 Georgia, serif;
  cursor: pointer;
}

.admin-aaa-body .import-info-button:hover,
.admin-aaa-body .import-info-button[aria-expanded="true"] {
  border-color: #7256e8;
  color: #ffffff;
  background: #6547df;
}

.admin-aaa-body .import-info-button:focus-visible {
  outline: 3px solid rgba(72, 118, 255, 0.3);
  outline-offset: 2px;
}

.admin-aaa-body .import-behavior-panel {
  display: grid;
  grid-template-rows: 0fr;
  width: min(760px, 100%);
  opacity: 0;
  transition: grid-template-rows 180ms ease, opacity 160ms ease, margin-top 180ms ease;
}

.admin-aaa-body .import-behavior-panel.is-open {
  grid-template-rows: 1fr;
  margin-top: 11px;
  opacity: 1;
}

.admin-aaa-body .import-behavior-panel-inner {
  min-height: 0;
  overflow: hidden;
}

.admin-aaa-body .import-behavior-panel-inner > strong,
.admin-aaa-body .import-behavior-panel-inner > p {
  display: block;
  padding-inline: 13px;
  color: #40516d;
  background: #f8faff;
}

.admin-aaa-body .import-behavior-panel-inner > strong {
  padding-top: 11px;
  border: 1px solid #d9e2f1;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  color: #293451;
  font-size: 0.84rem;
}

.admin-aaa-body .import-behavior-panel-inner > p {
  margin: 0;
  padding-top: 3px;
  padding-bottom: 11px;
  border: 1px solid #d9e2f1;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.admin-aaa-body .import-result-details {
  margin-top: 12px;
  border: 1px solid #cbd7ed;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.admin-aaa-body .import-result-details[hidden] {
  display: none !important;
}

.admin-aaa-body .import-result-details.has-errors {
  border-color: #e5b9c0;
}

.admin-aaa-body .import-result-details summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  color: #28344e;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.admin-aaa-body .import-result-details summary::-webkit-details-marker {
  display: none;
}

.admin-aaa-body .import-result-summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #ffffff;
  background: #6b4de6;
  font-size: 0.78rem;
}

.admin-aaa-body .import-result-details.has-errors .import-result-summary-icon {
  background: #b42338;
}

.admin-aaa-body .import-result-summary-action {
  color: #5b43d6;
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-aaa-body .import-result-details[open] .import-result-summary-action {
  font-size: 0;
}

.admin-aaa-body .import-result-details[open] .import-result-summary-action::after {
  content: "Hide details";
  font-size: 0.78rem;
}

.admin-aaa-body .import-result-report {
  padding: 0 14px 16px;
  border-top: 1px solid #e2e8f3;
}

.admin-aaa-body .import-result-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding-top: 14px;
}

.admin-aaa-body .import-result-metric {
  padding: 11px 12px;
  border: 1px solid #dbe3f1;
  border-radius: 12px;
  background: #f8faff;
}

.admin-aaa-body .import-result-metric span,
.admin-aaa-body .import-result-metric strong,
.admin-aaa-body .import-result-metric small {
  display: block;
}

.admin-aaa-body .import-result-metric span {
  color: #66758d;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-aaa-body .import-result-metric strong {
  margin-top: 3px;
  color: #172033;
  font-size: 1rem;
}

.admin-aaa-body .import-result-metric small {
  margin-top: 2px;
  color: #64748b;
  font-size: 0.74rem;
}

.admin-aaa-body .import-result-files > h4,
.admin-aaa-body .import-result-warning-block > h4 {
  margin: 17px 0 9px;
  color: #25304a;
  font-size: 0.84rem;
}

.admin-aaa-body .import-result-file {
  padding: 13px;
  border: 1px solid #e3b9c0;
  border-radius: 13px;
  background: #fff8f9;
}

.admin-aaa-body .import-result-file + .import-result-file {
  margin-top: 9px;
}

.admin-aaa-body .import-result-file-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.admin-aaa-body .import-result-file-number {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: #ffffff;
  background: #a61b31;
  font-size: 0.74rem;
  font-weight: 800;
}

.admin-aaa-body .import-result-file-head strong,
.admin-aaa-body .import-result-file-head span {
  display: block;
}

.admin-aaa-body .import-result-file-head strong {
  color: #651322;
  overflow-wrap: anywhere;
}

.admin-aaa-body .import-result-file-head div > span {
  margin-top: 2px;
  color: #8c2638;
  font-size: 0.78rem;
}

.admin-aaa-body .import-result-primary-error {
  margin: 10px 0 0;
  color: #4f2430;
  line-height: 1.48;
}

.admin-aaa-body .import-result-issue-list,
.admin-aaa-body .import-result-warning-block ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #4a556c;
  line-height: 1.48;
}

.admin-aaa-body .import-result-issue-list li + li,
.admin-aaa-body .import-result-warning-block li + li {
  margin-top: 6px;
}

.admin-aaa-body .import-fix-suggestions {
  margin-top: 13px;
  padding: 12px 13px;
  border: 1px solid #d9dfeb;
  border-radius: 11px;
  background: #ffffff;
}

.admin-aaa-body .import-fix-suggestions > strong {
  display: block;
  color: #26324a;
  font-size: 0.82rem;
}

.admin-aaa-body .import-fix-suggestions ol {
  margin: 9px 0 0;
  padding-left: 22px;
  color: #344158;
}

.admin-aaa-body .import-fix-suggestions li + li {
  margin-top: 9px;
}

.admin-aaa-body .import-fix-suggestions b,
.admin-aaa-body .import-fix-suggestions span {
  display: block;
}

.admin-aaa-body .import-fix-suggestions b {
  color: #28344c;
  font-size: 0.79rem;
}

.admin-aaa-body .import-fix-suggestions span {
  margin-top: 2px;
  color: #59657a;
  font-size: 0.78rem;
  line-height: 1.42;
}

.admin-aaa-body .import-fix-suggestions p {
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 0.72rem;
  line-height: 1.4;
}

.admin-aaa-body .import-result-warning-block {
  margin-top: 14px;
  padding: 1px 13px 13px;
  border: 1px solid #e6d3a7;
  border-radius: 13px;
  background: #fffbeb;
}

.admin-aaa-body .import-result-success-message {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid #afe0ca;
  border-radius: 12px;
  color: #176b4b;
  background: #f0fdf7;
  font-weight: 700;
}

.admin-aaa-body .import-review-block {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d7ccff;
  border-radius: 14px;
  background: #fbfaff;
}

.admin-aaa-body .import-review-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-aaa-body .import-review-heading h4 {
  margin: 0;
  color: #241c49;
  font-size: 0.94rem;
}

.admin-aaa-body .import-review-heading p {
  max-width: 760px;
  margin: 4px 0 0;
  color: #59657c;
  font-size: 0.8rem;
  line-height: 1.45;
}

.admin-aaa-body .import-review-heading > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  color: #ffffff;
  background: #6847e8;
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-aaa-body .import-review-cases {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.admin-aaa-body .import-review-case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid #e0daf6;
  border-radius: 12px;
  background: #ffffff;
  transition: border-color 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.admin-aaa-body .import-review-case.is-resolved {
  border-color: #afe0ca;
  background: #f5fdf9;
  opacity: 0.78;
}

.admin-aaa-body .import-review-case-copy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.admin-aaa-body .import-review-case-number {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: #ffffff;
  background: #6847e8;
  font-size: 0.72rem;
  font-weight: 800;
}

.admin-aaa-body .import-review-case-copy strong,
.admin-aaa-body .import-review-case-copy small {
  display: block;
}

.admin-aaa-body .import-review-case-copy strong {
  color: #241c49;
  overflow-wrap: anywhere;
}

.admin-aaa-body .import-review-case-copy small {
  margin-top: 2px;
  color: #6b5d9b;
  font-size: 0.72rem;
  font-weight: 750;
}

.admin-aaa-body .import-review-case-copy p {
  margin: 6px 0 0;
  color: #465169;
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-aaa-body .import-review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-aaa-body .import-review-actions .primary-btn,
.admin-aaa-body .import-review-actions .secondary-btn {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.admin-aaa-body .import-draft-card.is-import-review-target {
  border-color: #7657ec;
  box-shadow: 0 0 0 3px rgba(104, 71, 232, 0.16), 0 16px 34px rgba(50, 42, 91, 0.11);
}

.admin-aaa-body .import-draft-card.is-newly-imported {
  animation: import-draft-arrival 620ms ease-out both;
}

@keyframes import-draft-arrival {
  from { opacity: 0; transform: translateY(9px); box-shadow: 0 0 0 3px rgba(107, 77, 230, 0.18); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .admin-aaa-body .import-info-button {
    width: 44px;
    height: 44px;
    margin-top: -11px;
  }

  .admin-aaa-body .import-result-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-aaa-body .import-review-case {
    grid-template-columns: 1fr;
  }

  .admin-aaa-body .import-review-actions {
    justify-content: flex-start;
  }

  .admin-aaa-body .import-result-details summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admin-aaa-body .import-result-summary-action {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-aaa-body .import-behavior-panel,
  .admin-aaa-body .import-draft-card.is-newly-imported {
    animation: none;
    transition: none;
  }
}

@media (max-width: 1180px) {
  .admin-aaa-body .import-progress-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-aaa-body .import-progress-meta-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .admin-aaa-body .import-progress-head {
    flex-direction: column;
  }

  .admin-aaa-body .import-progress-percent {
    align-self: flex-start;
  }

  .admin-aaa-body .import-progress-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* Release-final component state layer. */
@media (min-width: 901px) {
  .admin-aaa-body .aaa-sidebar,
  .admin-aaa-body aside.aaa-sidebar {
    position: relative !important;
    inset: auto !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
    align-self: stretch !important;
  }
}
.admin-aaa-body .aaa-content-area,
.admin-aaa-body .content-area.aaa-content-area,
.admin-aaa-body .feedback-aaa-content { width: 100% !important; max-width: none !important; margin-inline: 0 !important; }
.admin-aaa-body select,
.admin-aaa-body select option,
.admin-aaa-body .aaa-themed-select,
.admin-aaa-body .aaa-themed-select option { color: #202638 !important; background: #ffffff !important; }
.admin-aaa-body .status-message.error,
.admin-aaa-body .roles-status.error,
.admin-aaa-body .role-panel-status.error,
.admin-aaa-body .security-status.error { color: #8a1728 !important; background: #ffeaee !important; border-color: #e9aab5 !important; }
.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card {
  color: #ffffff !important; background: linear-gradient(145deg, #17224a, #0b1232) !important; border-color: #344477 !important;
}
.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card-copy strong,
.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card-copy > span,
.admin-aaa-body .aaa-knowledge-card-groups.has-expanded-category .aaa-category-card-grid-item:not(.expanded) .aaa-category-card-chevron { color: #ffffff !important; }
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card {
  color: #ffffff !important;
  background: linear-gradient(90deg, #6245dc 0%, #7657ed 30%, #b8a9f5 62%, #ffffff 100%) !important;
  border: 2px solid #7657ed !important;
  box-shadow: 0 18px 42px rgba(95, 66, 212, 0.24) !important;
}
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-copy strong,
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-copy > span { color: #ffffff !important; text-shadow: 0 1px 2px rgba(32, 21, 92, 0.28); }
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-chevron { color: #4932b7 !important; }
.admin-aaa-body .aaa-category-open-indicator {
  display: inline-flex !important; width: fit-content; align-items: center; gap: 7px; margin-top: 12px !important; padding: 7px 10px; border: 1px solid rgba(255,255,255,0.54); border-radius: 999px; color: #ffffff !important; background: rgba(42, 25, 123, 0.48) !important; font-size: 0.78rem; font-weight: 700;
}
.admin-aaa-body .aaa-category-card-grid-item.expanded .aaa-category-card-count { color: #ffffff !important; background: #6b4de6 !important; border-color: #6b4de6 !important; }
.admin-aaa-body .import-draft-content,
.admin-aaa-body .aaa-category-card-preview { max-height: none !important; overflow: visible !important; mask-image: none !important; }
.admin-aaa-body .import-draft-card .card-actions { flex-wrap: wrap; }
.admin-aaa-body .auto-improve-draft-btn { color: #ffffff !important; background: linear-gradient(180deg, #7657ed, #6245dc) !important; border-color: transparent !important; }

.admin-aaa-body .import-source-metadata {
  margin: 9px 0 0;
  padding: 8px 10px;
  border: 1px solid #d8d0fb;
  border-radius: 10px;
  color: #49358f;
  background: #f5f1ff;
  font-size: 0.84rem;
  line-height: 1.4;
}

/* One uninterrupted bulk-delete surface with actual completion progress. */
.admin-aaa-body .import-delete-progress-overlay[hidden] {
  display: none !important;
}

.admin-aaa-body .import-delete-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: rgba(10, 14, 34, 0.62);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.admin-aaa-body.import-delete-progress-active {
  overflow: hidden;
}

.admin-aaa-body .import-delete-progress-dialog {
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 20px;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 28px 80px rgba(7, 10, 35, 0.38);
}

.admin-aaa-body .import-delete-progress-kicker {
  margin-bottom: 6px;
  color: #6245dc;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-aaa-body .import-delete-progress-dialog h2 {
  margin: 0 0 18px;
  color: #202638;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.admin-aaa-body .import-delete-progress-track {
  position: relative;
  height: 20px;
  overflow: hidden;
  border: 1px solid #d5d9e8;
  border-radius: 999px;
  background: #ebeef5;
  box-shadow: inset 0 1px 3px rgba(29, 37, 63, 0.15), 0 1px 0 rgba(255,255,255,0.9);
}

.admin-aaa-body .import-delete-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, #5035c7 0%, #6548dc 55%, #7658e8 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24);
  transition: width 180ms ease-out;
}

.admin-aaa-body .import-delete-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 28%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.08) 28%, rgba(255,255,255,0.48) 50%, rgba(255,255,255,0.08) 72%, transparent 100%);
  transform: translateX(-140%);
  animation: instint-delete-sheen 1.65s ease-in-out infinite;
}

.admin-aaa-body .import-delete-progress-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  padding: 0;
  color: #30295a;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 1px rgba(255,255,255,0.86);
  transition: color 150ms ease, text-shadow 150ms ease;
}

.admin-aaa-body .import-delete-progress-track.is-past-center .import-delete-progress-percent {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(39, 23, 101, 0.68);
}

.admin-aaa-body .import-delete-progress-track.is-complete .import-delete-progress-fill::after {
  opacity: 0;
  animation: none;
}

.admin-aaa-body .import-delete-progress-dialog p {
  margin: 13px 0 0;
  color: #55617a;
  font-size: 0.91rem;
  font-weight: 650;
  line-height: 1.45;
}

@keyframes instint-delete-sheen {
  0% { transform: translateX(-140%); opacity: 0; }
  18% { opacity: 1; }
  68% { opacity: 1; }
  100% { transform: translateX(370%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-aaa-body .import-delete-progress-fill,
  .admin-aaa-body .import-delete-progress-fill::after {
    transition: none;
    animation: none;
  }
}

/* Formatted knowledge editor: users review presentation instead of storage markers. */
.admin-aaa-body .knowledge-format-editor {
  overflow: hidden;
  border: 1px solid #cfd8e8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.admin-aaa-body .knowledge-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #dce3ef;
  background: #f5f7fc;
}
.admin-aaa-body .knowledge-format-toolbar button {
  width: auto;
  min-width: 38px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #cbd5e5;
  border-radius: 9px;
  color: #202638;
  background: #ffffff;
  font: inherit;
  font-weight: 750;
  line-height: 1;
}
.admin-aaa-body .knowledge-format-toolbar button:hover,
.admin-aaa-body .knowledge-format-toolbar button:focus-visible {
  color: #ffffff;
  background: #6245dc;
  border-color: #6245dc;
  outline: none;
}
.admin-aaa-body .knowledge-format-toolbar .format-red { color: #b42332; }
.admin-aaa-body .knowledge-format-toolbar .format-highlight { background: #fff19b; }
.admin-aaa-body .knowledge-format-surface {
  min-height: 230px;
  max-height: min(54vh, 620px);
  overflow: auto;
  padding: 14px 15px;
  color: #202638;
  background: #ffffff;
  font-size: 16px;
  line-height: 1.55;
  white-space: normal;
  outline: none;
  overflow-wrap: anywhere;
}
.admin-aaa-body .knowledge-format-surface:focus {
  box-shadow: inset 0 0 0 3px rgba(98, 69, 220, 0.22);
}
.admin-aaa-body .knowledge-format-surface:empty::before {
  content: attr(data-placeholder);
  color: #68758b;
  pointer-events: none;
}
.admin-aaa-body .knowledge-format-surface mark,
.admin-aaa-body .formatted-knowledge-content mark:not(.aaa-diff-unique) {
  padding: 0 0.12em;
  color: #211b09;
  background: #fff19b;
}
.admin-aaa-body .knowledge-format-surface sub,
.admin-aaa-body .knowledge-format-surface sup,
.admin-aaa-body .formatted-knowledge-content sub,
.admin-aaa-body .formatted-knowledge-content sup { line-height: 0; }
.admin-aaa-body .formatted-content-list-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5em;
  padding-left: var(--knowledge-list-indent, 0);
}
.admin-aaa-body .formatted-content-marker { font-variant-numeric: tabular-nums; }
.admin-aaa-body .import-format-note {
  margin: 12px 0 0;
  padding: 11px 13px;
  border: 1px solid #d9e2f1;
  border-radius: 12px;
  color: #40516d;
  background: #f8faff;
  font-size: 0.84rem;
  line-height: 1.45;
}
.admin-aaa-body .import-format-note strong { color: #293451; }
/* Knowledge Manager grouping, sorting, and top-aligned table rows. */
.admin-aaa-body .aaa-card-group-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: -10px;
  padding: 12px 14px;
  border: 1px solid #d7deea;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 26px rgba(31,42,74,0.05);
}

.admin-aaa-body .aaa-card-group-controls[hidden] {
  display: none !important;
}

.admin-aaa-body .aaa-card-group-controls label {
  color: #465268;
  font-size: 0.84rem;
  font-weight: 700;
}

.admin-aaa-body .aaa-card-group-controls select,
.admin-aaa-body .aaa-card-group-direction {
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #111827;
  background: #ffffff;
  font: inherit;
  font-weight: 650;
}

.admin-aaa-body .aaa-card-group-controls select {
  min-width: 190px;
  padding: 0 36px 0 12px;
}

.admin-aaa-body .aaa-card-group-direction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  padding: 0 13px;
}

.admin-aaa-body .aaa-knowledge-table-header,
.admin-aaa-body .aaa-table-entry-row {
  align-items: start !important;
}

.admin-aaa-body .aaa-knowledge-table-header {
  min-height: 48px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.admin-aaa-body .aaa-table-entry-row {
  min-height: 70px !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
  color: #253044 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

.admin-aaa-body .aaa-knowledge-table-shell > .aaa-table-entry-row:nth-of-type(even) {
  background: #f8fafc !important;
}

.admin-aaa-body .aaa-knowledge-table-shell > .aaa-table-entry-row:hover {
  background: #f2f6fb !important;
}

.admin-aaa-body .aaa-table-entry-category,
.admin-aaa-body .aaa-table-entry-title,
.admin-aaa-body .aaa-table-entry-preview,
.admin-aaa-body .aaa-table-entry-status,
.admin-aaa-body .aaa-table-entry-updated,
.admin-aaa-body .aaa-table-entry-actions {
  align-self: start !important;
}

.admin-aaa-body .aaa-table-entry-preview {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal !important;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.admin-aaa-body .aaa-sortable-column {
  min-width: 0;
}

.admin-aaa-body .aaa-table-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 30px;
  margin: 0;
  padding: 0 6px 0 0;
  border: 0;
  border-radius: 7px;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.admin-aaa-body .aaa-table-sort-button:hover,
.admin-aaa-body .aaa-table-sort-button:focus-visible {
  color: #4f37d6;
  background: #ece9ff;
  outline: none;
}

.admin-aaa-body .aaa-table-sort-button.active {
  color: #4932b7;
}

.admin-aaa-body .aaa-table-sort-arrow {
  color: #7463d8;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .admin-aaa-body .aaa-card-group-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .admin-aaa-body .aaa-card-group-controls label {
    grid-column: 1 / -1;
  }

  .admin-aaa-body .aaa-card-group-controls select,
  .admin-aaa-body .aaa-card-group-direction {
    width: 100%;
    min-width: 0;
  }
}

/* R14 final cascade: progress typography and seven-column knowledge sorting. */
.admin-aaa-body .import-delete-progress-dialog {
  max-width: calc(100vw - 32px);
}

.admin-aaa-body .import-delete-progress-dialog h2 {
  max-width: 100%;
  margin-bottom: 16px;
  color: #171c2c !important;
  font-size: clamp(1.12rem, 4.2vw, 1.42rem);
  line-height: 1.18;
  letter-spacing: -0.018em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.admin-aaa-body .import-delete-progress-dialog p {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: #55617a !important;
  line-height: 1.42;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-aaa-body .aaa-knowledge-table-shell {
  overflow-x: auto !important;
}

.admin-aaa-body .aaa-knowledge-table-header,
.admin-aaa-body .aaa-table-entry-row {
  grid-template-columns: 190px minmax(175px, 0.85fr) minmax(250px, 1.55fr) 100px 108px 108px 72px !important;
  min-width: 1060px;
}

.admin-aaa-body .aaa-table-entry-created,
.admin-aaa-body .aaa-table-entry-updated {
  min-width: 0;
  overflow: hidden;
  align-self: start !important;
  padding-right: 14px;
  color: #667085 !important;
  font-weight: 600 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .admin-aaa-body .import-delete-progress-dialog {
    padding: 22px 20px;
    border-radius: 18px;
  }

  .admin-aaa-body .import-delete-progress-dialog h2 {
    font-size: 1.18rem;
  }
}


/* ==========================================================================
   Roles and permissions
   Source: styles-src/40-roles.css
   ========================================================================== */
.roles-page {
  gap: 18px;
}

.roles-page-header {
  align-items: center;
}

.roles-controls {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 18px;
}

.roles-control-group {
  display: grid;
  gap: 8px;
  min-width: min(360px, 100%);
}

.roles-control-group label,
.roles-code-preview span {
  color: var(--aaa-muted);
  font-size: 0.9rem;
}

.roles-control-group select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(15,23,42,.72);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
}

.roles-code-preview,
.role-generated-box {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.roles-code-preview strong,
.role-generated-box strong {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: .06em;
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.role-card {
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(15,23,42,.88), rgba(15,23,42,.72));
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

.role-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.role-card h3 {
  margin: 4px 0 2px;
  color: #fff;
}

.role-meta,
.role-categories,
.roles-status {
  color: var(--aaa-muted);
}

.roles-status.error {
  color: #fecaca;
}

.role-login-row {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.role-login-code {
  flex: 1;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  padding: 10px 12px;
  border-radius: 12px;
  color: #fff;
}

.role-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.role-status-pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: .78rem;
  background: rgba(34,197,94,.13);
  color: #86efac;
  border: 1px solid rgba(34,197,94,.25);
}

.role-status-pill.disabled {
  background: rgba(148,163,184,.12);
  color: #cbd5e1;
  border-color: rgba(148,163,184,.22);
}

.roles-empty {
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 18px;
  padding: 28px;
  color: var(--aaa-muted);
  background: rgba(15,23,42,.45);
}

/* Role editor: intentionally mirrors the Knowledge Manager editor panel. */
.roles-editor-panel {
  z-index: 95;
}

.roles-editor-panel > .panel-header,
.roles-editor-panel > .panel-body {
  width: min(720px, 100%);
}

.roles-editor-panel .panel-header {
  min-height: 92px;
  height: auto;
  padding: 20px 22px;
  align-items: center;
}

.roles-editor-panel .panel-header h2 {
  color: #111827;
  margin: 0 0 4px;
}

.roles-editor-panel .panel-header p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.4;
}

.roles-editor-panel .panel-body {
  padding: 22px;
}

.roles-editor-panel .field-label,
.roles-editor-panel .role-category-header strong,
.roles-editor-panel .role-generated-box span {
  display: block;
  margin: 0 0 8px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
}

.roles-editor-panel #roleName,
.roles-editor-panel #roleCode {
  width: 100%;
  height: auto;
  min-height: 50px;
  margin: 0 0 16px;
  padding: 13px 14px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  box-shadow: none;
  font-size: 15px;
  font-weight: 700;
}

.roles-editor-panel #roleName::placeholder,
.roles-editor-panel #roleCode::placeholder {
  color: #94a3b8;
}

.roles-editor-panel #roleName:focus,
.roles-editor-panel #roleCode:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.roles-editor-panel .role-generated-box {
  margin: 2px 0 18px;
  border: 1px solid #dbe2ea;
  background: #f8fafc;
  box-shadow: none;
}

.roles-editor-panel .role-generated-box strong {
  color: #111827;
}

.roles-editor-panel .role-category-block {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.roles-editor-panel .role-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.roles-editor-panel .role-category-header strong {
  margin: 0;
}

.roles-editor-panel .role-category-checks {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 2px 4px 2px 0;
}

.roles-editor-panel .role-category-checks label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  color: #111827;
  font-weight: 600;
}

.roles-editor-panel .role-category-checks input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin: 0;
  accent-color: #2563eb;
  box-shadow: none;
}

.roles-editor-panel .toggle-row {
  color: #374151;
}

.roles-editor-panel .panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.roles-editor-panel .danger-outline-btn {
  background: #fff7f7;
  color: #dc2626;
  border: 1px solid #f3d1d1;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 18px;
}

@media (max-width: 900px) {
  .roles-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .roles-editor-panel .panel-actions {
    grid-template-columns: 1fr;
  }
}


/* Roles modal label visibility fix */
.role-modal label,
.roles-modal label,
#roleModal label,
#roleEditor label,
.role-editor label,
.roles-editor label,
.role-form label,
.roles-form label {
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  display: block;
}

.role-modal .form-label,
.roles-modal .form-label,
#roleModal .form-label,
#roleEditor .form-label,
.role-editor .form-label,
.roles-editor .form-label,
.role-modal .field-label,
.roles-modal .field-label,
#roleModal .field-label,
#roleEditor .field-label,
.role-editor .field-label,
.roles-editor .field-label,
.role-modal .section-label,
.roles-modal .section-label,
#roleModal .section-label,
#roleEditor .section-label,
.role-editor .section-label,
.roles-editor .section-label,
.role-categories-title,
.categories-label {
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 600;
}

.role-modal .category-option,
.roles-modal .category-option,
#roleModal .category-option,
#roleEditor .category-option,
.role-editor .category-option,
.roles-editor .category-option {
  color: #0f172a !important;
}


/* Roles editor polish: match Admin modal styling */
.roles-editor-panel .panel-header p {
  color: rgba(248, 251, 255, 0.88) !important;
}

.roles-editor-panel .field-label,
.roles-editor-panel .role-category-header strong,
.roles-editor-panel .role-generated-box span {
  color: #f8fafc !important;
  font-size: 14px;
  font-weight: 600;
}

.roles-editor-panel .role-generated-box {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  display: grid;
  gap: 8px;
}

.roles-editor-panel .role-generated-box span {
  margin: 0;
}

.roles-editor-panel .role-generated-box strong {
  display: block;
  width: fit-content;
  min-width: 150px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff !important;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: none;
}

.roles-editor-panel .role-category-checks {
  padding-right: 8px;
}

.roles-editor-panel .role-category-checks label {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(132, 157, 255, 0.28);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.10), transparent 32%),
    linear-gradient(135deg, rgba(18, 24, 62, 0.78), rgba(8, 12, 42, 0.82));
  color: rgba(248, 251, 255, 0.92) !important;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 0 0 1px rgba(255,255,255,0.02) inset;
}

.roles-editor-panel .role-category-checks label:hover {
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.13), transparent 32%),
    linear-gradient(135deg, rgba(27, 39, 92, 0.88), rgba(12, 18, 56, 0.90));
  border-color: rgba(167, 184, 255, 0.42);
}

.roles-editor-panel .role-category-checks input[type="checkbox"] {
  accent-color: var(--aaa-blue);
}

.role-security-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.role-security-summary span {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.10);
  color: #dbeafe;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 600;
}

.roles-editor-panel .role-security-block {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid rgba(132, 157, 255, 0.28);
  border-radius: 16px;
  background: rgba(8, 12, 42, 0.35);
}

.roles-editor-panel .role-security-header {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
}

.roles-editor-panel .role-security-header strong {
  color: #fff;
  font-size: 15px;
}

.roles-editor-panel .role-security-header span,
.roles-editor-panel .role-credential-status {
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
}

.roles-editor-panel #roleEmail,
.roles-editor-panel #rolePassword,
.roles-editor-panel .role-mfa-code-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

.roles-editor-panel .role-checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: rgba(248, 251, 255, 0.92) !important;
  font-weight: 700;
}

.roles-editor-panel .role-checkbox-line input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--aaa-blue);
}

.role-mfa-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.role-mfa-setup-box[hidden] {
  display: none;
}

.role-mfa-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.role-mfa-card p {
  margin: 0;
  color: rgba(226, 232, 240, 0.78);
}

.role-mfa-qr {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.role-mfa-secret {
  display: grid;
  gap: 4px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
}

.role-mfa-secret code {
  color: #fff;
  word-break: break-all;
}


.role-field-hint {
  color: rgba(226, 232, 240, 0.72);
  font-size: 12px;
  line-height: 1.35;
  margin-top: -4px;
}

.role-panel-status {
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.10);
  color: #dbeafe;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.role-panel-status:empty,
.role-panel-status[hidden] {
  display: none;
}

.role-panel-status.error {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.26);
  color: #fecaca;
}

.role-security-modal-grid select {
  width: 100%;
  min-height: 46px;
}

.roles-editor-panel .primary-btn:disabled,
.roles-editor-panel .secondary-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

/* Staff user account list: matches Knowledge Manager row/list styling. */
.role-users-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.role-users-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.role-users-heading-row h2 {
  margin: 0 0 5px;
  color: #fff;
  font-size: 20px;
}

.role-users-heading-row p {
  margin: 0;
  color: var(--aaa-muted);
}

.role-users-table-shell {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(136, 158, 255, 0.26);
  border-radius: 16px;
  background: rgba(7, 12, 38, 0.82);
}

.role-users-table-header,
.role-user-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) 132px minmax(260px, 1.35fr) minmax(220px, 1.05fr) 86px;
  align-items: center;
  gap: 16px;
}

.role-users-table-header {
  min-height: 44px;
  padding: 0 18px;
  color: rgba(232, 238, 255, 0.76);
  background: rgba(20, 34, 78, 0.92);
  border-bottom: 1px solid rgba(136, 158, 255, 0.22);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.role-user-row {
  min-height: 70px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(136, 158, 255, 0.11);
  color: rgba(248, 251, 255, 0.88);
  font-size: 14px;
}

.role-user-row:last-child {
  border-bottom: 0;
}

.role-user-row:nth-child(odd) {
  background: rgba(10, 18, 52, 0.58);
}

.role-user-row:nth-child(even) {
  background: rgba(15, 27, 66, 0.74);
}

.role-user-row:hover {
  background: rgba(39, 63, 128, 0.58);
}

.role-user-main,
.role-user-security,
.role-user-setup {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.role-user-main strong {
  color: #fff;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-user-main span,
.role-user-security small,
.role-user-setup small {
  color: rgba(224, 232, 255, 0.68);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-user-code {
  color: rgba(230, 237, 255, 0.86);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  font-weight: 700;
}

.role-user-security-select,
.roles-editor-panel .role-security-select,
.role-security-modal select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(132, 157, 255, 0.28);
  border-radius: 11px;
  background: rgba(238, 244, 255, 0.07);
  color: #fff;
  font-weight: 600;
}

.role-user-security-select option,
.roles-editor-panel .role-security-select option,
.role-security-modal select option {
  background: #0f172a;
  color: #fff;
}

.role-user-setup {
  grid-template-columns: repeat(3, max-content);
  align-items: center;
  gap: 7px;
}

.role-user-setup small {
  grid-column: 1 / -1;
}

.role-user-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.10);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.role-user-pill.ready {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.13);
  color: #86efac;
}

.role-user-pill.warn {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
}

.role-user-actions {
  display: flex;
  justify-content: flex-end;
}

.role-users-empty {
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 18px;
  padding: 22px;
  color: var(--aaa-muted);
  background: rgba(15,23,42,.45);
  display: grid;
  gap: 4px;
}

/* User security modal. */
.role-security-overlay[hidden] {
  display: none;
}

.role-security-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
}

.role-security-modal {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
}

.role-security-modal-header,
.role-security-modal-actions {
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.role-security-modal-actions {
  border-top: 1px solid #e5e7eb;
  border-bottom: 0;
  justify-content: flex-end;
}

.role-security-modal-header h2 {
  margin: 0;
  color: #111827;
}

.role-security-modal-header p {
  margin: 6px 0 0;
  color: #6b7280;
}

.role-security-modal-body {
  padding: 22px;
  display: grid;
  gap: 10px;
  overflow: auto;
}

.role-security-modal-body label {
  color: #374151;
  font-weight: 600;
  font-size: 14px;
}

.role-security-modal input[type="email"],
.role-security-modal input[type="password"],
.role-security-modal .role-mfa-code-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

.role-security-modal select {
  background: #fff;
  color: #111827;
  border-color: #dbe2ea;
}

.role-security-modal select option {
  background: #fff;
  color: #111827;
}

.role-security-modal .role-field-hint {
  color: #64748b;
}

.role-security-modal-checkline {
  color: #374151 !important;
}

.role-security-modal-checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--aaa-blue);
}

.role-security-modal .role-credential-status {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.role-security-modal .role-mfa-card {
  border-color: #e5e7eb;
  background: #f8fafc;
  color: #111827;
}

.role-security-modal .role-mfa-card p,
.role-security-modal .role-mfa-secret {
  color: #64748b;
}

.role-security-modal .role-mfa-secret code {
  color: #111827;
}

@media (max-width: 1180px) {
  .role-users-table-shell {
    overflow-x: auto;
  }

  .role-users-table-header,
  .role-user-row {
    min-width: 980px;
  }
}

@media (max-width: 900px) {
  .role-users-heading-row {
    flex-direction: column;
  }

  .role-security-modal-actions {
    flex-direction: column-reverse;
  }

  .role-security-modal-actions button {
    width: 100%;
  }
}

/* Updated staff user management layout and dark dropdown theme. */
.role-users-heading-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-users-table-header,
.role-user-row {
  grid-template-columns: minmax(170px, 1fr) minmax(120px, .55fr) minmax(220px, 1.05fr) minmax(260px, 1.3fr) minmax(150px, .7fr);
}

.role-user-code,
.role-user-email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(248, 251, 255, 0.9);
  font-weight: 700;
}

.role-user-actions {
  gap: 8px;
}

.role-user-actions .role-user-remove-btn {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.3);
}

.roles-editor-panel .role-security-select,
.role-user-security-select,
.role-security-modal select,
.role-security-modal .aaa-themed-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: rgba(19, 31, 76, 0.96) !important;
  background-image:
    linear-gradient(180deg, rgba(78, 97, 179, 0.38), rgba(17, 27, 68, 0.38)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.92)' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 0 0, right 16px center !important;
  background-size: auto, 18px !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: rgba(132, 157, 255, 0.42) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 12px 26px rgba(0,0,0,.18) !important;
  padding-right: 50px !important;
}

.roles-editor-panel .role-security-select option,
.role-user-security-select option,
.role-security-modal select option,
.role-security-modal .aaa-themed-select option {
  color: rgba(248, 251, 255, 0.96) !important;
  background-color: #131f4c !important;
}

.roles-editor-panel .role-security-select option:nth-child(even),
.role-user-security-select option:nth-child(even),
.role-security-modal select option:nth-child(even),
.role-security-modal .aaa-themed-select option:nth-child(even) {
  background-color: #182762 !important;
}

.roles-editor-panel .role-security-select option:checked,
.roles-editor-panel .role-security-select option:hover,
.role-user-security-select option:checked,
.role-user-security-select option:hover,
.role-security-modal select option:checked,
.role-security-modal select option:hover,
.role-security-modal .aaa-themed-select option:checked,
.role-security-modal .aaa-themed-select option:hover {
  color: #ffffff !important;
  background-color: #3656c9 !important;
}

.role-security-modal-grid {
  display: grid;
  gap: 14px;
}

.role-security-modal-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.role-security-modal input[type="text"],
.role-security-modal input[type="email"],
.role-security-modal input[type="password"],
.role-security-modal .role-mfa-code-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

.new-user-role-fields {
  border: 1px solid rgba(132, 157, 255, 0.28);
  border-radius: 14px;
  background: rgba(30, 41, 87, 0.08);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.new-user-role-fields[hidden] {
  display: none;
}

.role-security-modal-actions .role-modal-action-spacer {
  flex: 1;
}

.role-security-modal-actions .danger-outline-btn[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .role-users-table-header,
  .role-user-row {
    min-width: 880px;
  }
}

@media (max-width: 900px) {
  .role-users-heading-actions {
    width: 100%;
    justify-content: stretch;
  }

  .role-users-heading-actions button {
    flex: 1;
  }

  .role-security-modal-grid.two-col {
    grid-template-columns: 1fr;
  }
}

/* Staff user modal polish: stronger destructive action contrast and reliable dark dropdowns. */
.role-security-modal-actions .danger-outline-btn,
.role-security-modal-actions .danger-outline-btn:not(:disabled),
.role-security-modal-actions .danger-outline-btn:enabled {
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
  background: #fff5f5 !important;
  border-color: #ef4444 !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

.role-security-modal-actions .danger-outline-btn:hover,
.role-security-modal-actions .danger-outline-btn:focus-visible {
  color: #b91c1c !important;
  -webkit-text-fill-color: #b91c1c !important;
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
}

.roles-editor-panel .role-security-select,
.role-user-security-select,
.role-security-modal select,
.role-security-modal .aaa-themed-select {
  color-scheme: dark !important;
}

.roles-editor-panel .role-security-select option:disabled,
.role-user-security-select option:disabled,
.role-security-modal select option:disabled,
.role-security-modal .aaa-themed-select option:disabled {
  color: rgba(174, 187, 214, 0.62) !important;
  -webkit-text-fill-color: rgba(174, 187, 214, 0.62) !important;
  background-color: #0f193d !important;
}

/* Staff user modal: use the site's red secondary-button theme inside the white modal. */
.role-security-modal .secondary-btn,
.role-security-modal .secondary-btn:not(:disabled),
.role-security-modal .secondary-btn:enabled {
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
  background: #fff7f7 !important;
  border: 1px solid #f3b4b4 !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

.role-security-modal .secondary-btn:hover,
.role-security-modal .secondary-btn:focus-visible {
  color: #b91c1c !important;
  -webkit-text-fill-color: #b91c1c !important;
  background: #feeaea !important;
  border-color: #ef4444 !important;
}

.role-security-modal .secondary-btn:disabled,
.role-security-modal .secondary-btn[disabled] {
  color: rgba(220, 38, 38, 0.58) !important;
  -webkit-text-fill-color: rgba(220, 38, 38, 0.58) !important;
  background: #fff7f7 !important;
  border-color: rgba(243, 180, 180, 0.72) !important;
  opacity: 0.72 !important;
  cursor: not-allowed !important;
}


/* =========================================================
   FINAL OVERRIDE: ROLE CODE FONT STACK
   ========================================================= */
.roles-code-preview strong,
.role-generated-box strong,
.role-login-code,
.role-user-code,
.role-mfa-secret code,
.role-mfa-code-input,
#roleCode,
#userEmployeeCode,
#userNewRoleCode {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, monospace !important;
}

/* =========================================================
   FINAL OVERRIDE: LIGHT ROLES UI ALIGNMENT
   Keeps Roles & Access consistent with the light admin menus.
   ========================================================= */
.roles-page .aaa-panel-card,
.roles-page .roles-controls,
.roles-page .role-users-card,
.roles-page .role-card,
.roles-page .roles-empty,
.roles-page .role-users-empty {
  color: var(--aaa-ink) !important;
  background:
    radial-gradient(circle at 92% 10%, rgba(106, 77, 245, 0.065), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #f8f9fd 100%) !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.075) !important;
}

.roles-page .roles-control-group label,
.roles-page .roles-code-preview span,
.roles-page .role-meta,
.roles-page .role-categories,
.roles-page .roles-status,
.roles-page .role-users-heading-row p,
.roles-page .role-field-hint {
  color: var(--aaa-muted) !important;
}

.roles-page .roles-control-group select,
.roles-page .role-user-security-select,
.roles-page .roles-editor-panel .role-security-select {
  color: #1f2937 !important;
  -webkit-text-fill-color: #1f2937 !important;
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: var(--aaa-shadow-sm) !important;
}

.roles-page .roles-control-group select option,
.roles-page .role-user-security-select option,
.roles-page .roles-editor-panel .role-security-select option {
  color: #1f2937 !important;
  background: #ffffff !important;
}

.roles-page .roles-code-preview,
.roles-page .role-login-code,
.roles-page .role-generated-box,
.roles-page .role-security-summary span,
.roles-page .role-user-pill {
  background: #f3f5fa !important;
  border: 1px solid var(--aaa-line) !important;
  color: #374151 !important;
  box-shadow: none !important;
}

.roles-page .roles-code-preview strong,
.roles-page .role-generated-box strong,
.roles-page .role-login-code,
.roles-page .role-user-code {
  color: #24304a !important;
  -webkit-text-fill-color: #24304a !important;
}

.roles-page .role-card h3,
.roles-page .role-users-heading-row h2,
.roles-page .role-user-main strong,
.roles-page .role-user-email,
.roles-page .role-user-security,
.roles-page .role-user-setup,
.roles-page .role-user-row {
  color: var(--aaa-ink) !important;
}

.roles-page .role-status-pill,
.roles-page .role-user-pill.ready {
  color: #155e46 !important;
  background: #eaf8f1 !important;
  border-color: #bee8d3 !important;
}

.roles-page .role-status-pill.disabled,
.roles-page .role-user-pill.warn {
  color: #7a4b00 !important;
  background: #fff7dd !important;
  border-color: #f4daa2 !important;
}

.roles-page .role-users-table-shell {
  border: 1px solid var(--aaa-line) !important;
  background: #ffffff !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.075) !important;
}

.roles-page .role-users-table-header {
  color: #374151 !important;
  background: #f3f5fa !important;
  border-bottom: 1px solid var(--aaa-line) !important;
}

.roles-page .role-user-row {
  background: #ffffff !important;
  border-bottom: 1px solid var(--aaa-line) !important;
}

.roles-page .role-user-row:nth-child(odd) {
  background: #fbfcff !important;
}

.roles-page .role-user-row:nth-child(even) {
  background: #f6f8fc !important;
}

.roles-page .role-user-row:hover {
  background: #eef3ff !important;
}

.roles-page .role-user-main span,
.roles-page .role-user-security small,
.roles-page .role-user-setup small {
  color: #5f687d !important;
}

.roles-page .role-user-actions .secondary-btn,
.roles-page .role-user-actions .card-btn,
.roles-page .role-user-actions button {
  color: #1f2937 !important;
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
}

.roles-page .role-user-actions .role-user-remove-btn {
  color: #b42335 !important;
  background: #fff5f6 !important;
  border-color: #efc6cc !important;
}

/* =========================================================
   FINAL OVERRIDE: Light role and staff-user prompt refresh
   Matches the current light admin UI and fixes dark dropdowns.
   ========================================================= */
.roles-editor-panel .panel-header,
.roles-editor-panel .panel-body,
#rolePanel.roles-editor-panel > .panel-header,
#rolePanel.roles-editor-panel > .panel-body {
  background: #fbfcff !important;
  color: #111827 !important;
  border-color: #d4dce8 !important;
}

.roles-editor-panel .panel-header p,
.roles-editor-panel .field-label,
.roles-editor-panel label,
.roles-editor-panel .role-category-header strong,
.roles-editor-panel .role-security-header strong,
.roles-editor-panel .role-security-header span,
.roles-editor-panel .role-generated-box span,
.roles-editor-panel .role-field-hint,
.roles-editor-panel .role-checkbox-line,
.roles-editor-panel .role-checkbox-line span,
.roles-editor-panel .toggle-row,
.roles-editor-panel .toggle-row span {
  color: #344054 !important;
  -webkit-text-fill-color: #344054 !important;
  font-weight: 500 !important;
}

.roles-editor-panel #roleName,
.roles-editor-panel #roleCode,
.roles-editor-panel #roleSecurityLevelOverride,
.roles-editor-panel .role-security-select {
  color-scheme: light !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}

.roles-editor-panel #roleSecurityLevelOverride,
.roles-editor-panel .role-security-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 46px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235f687d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 18px !important;
}

.roles-editor-panel #roleSecurityLevelOverride option,
.roles-editor-panel .role-security-select option {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: #ffffff !important;
}

.roles-editor-panel .role-security-block,
.roles-editor-panel .role-category-block,
.roles-editor-panel .role-generated-box,
.roles-editor-panel .new-user-role-fields {
  background: #f8fafc !important;
  border: 1px solid #d4dce8 !important;
  color: #111827 !important;
  box-shadow: none !important;
}

.roles-editor-panel .role-generated-box {
  padding: 12px 14px !important;
  border-radius: 12px !important;
}

.roles-editor-panel .role-generated-box strong {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 600 !important;
}

.roles-editor-panel .role-category-checks {
  background: #ffffff !important;
  border: 1px solid #d4dce8 !important;
  border-radius: 14px !important;
}

.roles-editor-panel .role-category-checks label,
.roles-editor-panel .role-category-checks .role-category-row,
.roles-editor-panel .role-category-checks .role-checkbox-line {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  font-weight: 500 !important;
}

.roles-editor-panel .role-category-checks label:nth-child(even),
.roles-editor-panel .role-category-checks .role-category-row:nth-child(even) {
  background: #f8fafc !important;
}

.role-security-overlay {
  background: rgba(15, 23, 42, 0.42) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  padding: 18px !important;
}

.role-security-modal {
  width: min(860px, calc(100vw - 36px)) !important;
  max-height: 96vh !important;
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #d4dce8 !important;
  border-radius: 22px !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.20) !important;
}

.role-security-modal-header,
.role-security-modal-actions {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  padding: 16px 22px !important;
}

.role-security-modal-header h2 {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 700 !important;
}

.role-security-modal-header p,
.role-security-modal-body label,
.role-security-modal .role-field-hint,
.role-security-modal .role-credential-status,
.role-security-modal-checkline,
.role-security-modal-checkline span {
  color: #344054 !important;
  -webkit-text-fill-color: #344054 !important;
  font-weight: 500 !important;
}

.role-security-modal-body {
  padding: 16px 22px !important;
  gap: 8px !important;
  overflow-y: auto !important;
}

.role-security-modal-grid {
  gap: 10px 14px !important;
}

.role-security-modal input[type="text"],
.role-security-modal input[type="email"],
.role-security-modal input[type="password"],
.role-security-modal input[type="number"],
.role-security-modal select,
.role-security-modal .aaa-themed-select,
.role-security-modal .role-mfa-code-input {
  min-height: 44px !important;
  width: 100% !important;
  color-scheme: light !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  font-weight: 500 !important;
  padding: 10px 14px !important;
}

.role-security-modal select,
.role-security-modal .aaa-themed-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 46px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235f687d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 18px !important;
}

.role-security-modal select option,
.role-security-modal .aaa-themed-select option {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: #ffffff !important;
}

.role-security-modal select option:disabled,
.role-security-modal .aaa-themed-select option:disabled {
  color: #98a2b3 !important;
  -webkit-text-fill-color: #98a2b3 !important;
  background: #f8fafc !important;
}

.role-security-modal .role-mfa-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.role-security-modal .primary-btn,
.role-security-modal-actions .primary-btn {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #6a4df5 !important;
  border: 1px solid #6047e8 !important;
  box-shadow: 0 12px 24px rgba(106, 77, 245, 0.18) !important;
}

.role-security-modal .secondary-btn,
.role-security-modal .secondary-btn:not(:disabled),
.role-security-modal .secondary-btn:enabled,
.role-security-modal-actions .secondary-btn {
  color: #b42318 !important;
  -webkit-text-fill-color: #b42318 !important;
  background: #fff7f7 !important;
  border: 1px solid #fecaca !important;
  box-shadow: none !important;
}

.role-security-modal .danger-outline-btn,
.role-security-modal-actions .danger-outline-btn,
.role-security-modal-actions .danger-outline-btn:not(:disabled),
.role-security-modal-actions .danger-outline-btn:enabled {
  color: #b42318 !important;
  -webkit-text-fill-color: #b42318 !important;
  background: #fff7f7 !important;
  border: 1px solid #ef4444 !important;
  box-shadow: none !important;
}

@media (min-width: 840px) and (min-height: 780px) {
  .role-security-modal-body {
    overflow-y: visible !important;
  }
}

@media (max-width: 900px) {
  .role-security-modal-grid.two-col {
    grid-template-columns: 1fr !important;
  }

  .role-security-modal-body {
    overflow-y: auto !important;
  }
}


/* ==========================================================================
   Feedback
   Source: styles-src/50-feedback.css
   ========================================================================== */
.feedback-aaa-body .aaa-refresh-top {
  min-width: 122px;
}

.feedback-aaa-content {
  width: 100%;
  max-width: none;
}

.aaa-analytics-tabs {
  position: relative;
  border: 1px solid var(--aaa-line-strong);
  border-radius: 22px;
  padding: 22px 24px 8px;
  margin-bottom: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 8% 0%, rgba(28, 119, 255, 0.25), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(199, 60, 255, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(245, 248, 255, 0.18), rgba(229, 237, 255, 0.08));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255,255,255,.035) inset;
  backdrop-filter: blur(22px) saturate(156%);
  -webkit-backdrop-filter: blur(22px) saturate(156%);
  overflow: hidden;
}

.aaa-tab-buttons,
.analytics-tab-buttons.aaa-tab-buttons {
  display: inline-flex;
  gap: 8px;
  padding: 7px;
  background: rgba(5, 9, 31, 0.48);
  border: 1px solid rgba(171, 190, 255, 0.24);
  border-radius: 16px;
  margin-bottom: 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.aaa-tab-buttons .analytics-tab-btn,
.analytics-tab-buttons.aaa-tab-buttons .analytics-tab-btn {
  color: rgba(248, 251, 255, 0.72);
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 700;
}

.aaa-tab-buttons .analytics-tab-btn.active,
.analytics-tab-buttons.aaa-tab-buttons .analytics-tab-btn.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(28, 119, 255, 0.92), rgba(124, 53, 255, 0.82));
  box-shadow: 0 12px 28px rgba(58, 74, 255, 0.24), 0 0 26px rgba(156, 52, 255, 0.22);
}

.aaa-tab-panel,
.analytics-tab-panel.aaa-tab-panel {
  display: none;
}

.aaa-tab-panel.active,
.analytics-tab-panel.aaa-tab-panel.active {
  display: block;
}

.aaa-section-header-mini,
.analytics-section-header.aaa-section-header-mini {
  margin: 6px 0 16px;
}

.aaa-section-header-mini h2,
.analytics-section-header.aaa-section-header-mini h2,
.feedback-aaa-body .analytics-panel-header h2 {
  color: #fff;
  letter-spacing: -0.03em;
}

.aaa-section-header-mini p,
.analytics-section-header.aaa-section-header-mini p,
.feedback-aaa-body .analytics-panel-header p {
  color: var(--aaa-ink-soft);
}

.aaa-summary-grid,
.feedback-summary-grid.aaa-summary-grid,
.analytics-summary-grid.aaa-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.aaa-summary-grid .summary-card,
.feedback-aaa-body .summary-card {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  border: 1px solid rgba(223, 232, 255, 0.42);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,255,255,0.22), transparent 34%),
    linear-gradient(145deg, rgba(246, 249, 255, 0.19), rgba(226, 235, 255, 0.09));
  color: #fff;
  box-shadow: 0 16px 46px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.03) inset;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.feedback-aaa-body .summary-card span {
  color: rgba(248, 251, 255, 0.68);
}

.feedback-aaa-body .summary-card strong {
  color: #fff;
  text-shadow: 0 0 22px rgba(84, 123, 255, 0.22);
}

.feedback-aaa-body .summary-card.danger strong {
  color: #ff7192;
  text-shadow: 0 0 22px rgba(255, 71, 118, 0.24);
}

.aaa-glass-panel,
.analytics-panel.aaa-glass-panel,
.aaa-association-suggestions-panel {
  position: relative;
  border: 1px solid var(--aaa-line-strong);
  border-radius: 20px;
  padding: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.16), transparent 28%),
    linear-gradient(145deg, rgba(245, 248, 255, 0.18), rgba(229, 237, 255, 0.09));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255,255,255,.035) inset;
  backdrop-filter: blur(22px) saturate(156%);
  -webkit-backdrop-filter: blur(22px) saturate(156%);
}

.aaa-association-suggestions-panel {
  margin-bottom: 24px;
}

.feedback-aaa-body .analytics-row,
.feedback-aaa-body .association-suggestion-row,
.feedback-aaa-body .analytics-feedback-card {
  color: #fff;
  border: 1px solid rgba(238, 244, 255, 0.16);
  background: rgba(238, 244, 255, 0.10);
  border-radius: 16px;
}

.feedback-aaa-body .analytics-row strong,
.feedback-aaa-body .analytics-feedback-top strong {
  color: #fff;
}

.feedback-aaa-body .analytics-row span,
.feedback-aaa-body .analytics-feedback-top span,
.feedback-aaa-body .analytics-feedback-card p {
  color: rgba(248, 251, 255, 0.72);
}

.feedback-aaa-body .analytics-row-stat {
  color: #56c8ff;
  text-shadow: 0 0 12px rgba(24, 196, 255, 0.28);
}

.aaa-review-tabs {
  margin-bottom: 2px;
}

.aaa-feedback-filters,
.filters-row.aaa-feedback-filters {
  grid-template-columns: 1.35fr 0.65fr;
}

.aaa-feedback-analytics-grid,
.analytics-grid.aaa-feedback-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.aaa-feedback-groups,
.feedback-groups.aaa-feedback-groups {
  gap: 20px;
}

.feedback-aaa-body .feedback-topic-card {
  position: relative;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(223, 232, 255, 0.46);
  border-radius: 20px;
  padding: 22px;
  background:
    radial-gradient(circle at 7% 4%, rgba(28, 119, 255, 0.25), transparent 32%),
    radial-gradient(circle at 95% 8%, rgba(199, 60, 255, 0.18), transparent 35%),
    linear-gradient(145deg, rgba(245, 248, 255, 0.19), rgba(229, 237, 255, 0.09));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255,255,255,.035) inset;
  backdrop-filter: blur(22px) saturate(156%);
  -webkit-backdrop-filter: blur(22px) saturate(156%);
}

.feedback-aaa-body .feedback-topic-card.urgent-feedback {
  border-color: rgba(255, 71, 118, 0.72);
  box-shadow: 0 18px 54px rgba(0,0,0,.22), 0 0 34px rgba(255,71,118,.16);
}

.feedback-aaa-body .feedback-topic-header h2,
.feedback-aaa-body .card-title {
  color: #fff;
}

.feedback-aaa-body .topic-label,
.feedback-aaa-body .feedback-metrics span {
  color: rgba(248, 251, 255, 0.62);
}

.feedback-aaa-body .topic-status {
  color: #caffea;
  border: 1px solid rgba(41, 217, 139, 0.28);
  background: rgba(41, 217, 139, 0.15);
}

.feedback-aaa-body .topic-status.needs-review {
  color: #ffd2dd;
  border-color: rgba(255, 71, 118, 0.35);
  background: rgba(255, 71, 118, 0.16);
}

.feedback-aaa-body .feedback-metrics div,
.feedback-aaa-body .latest-feedback {
  color: #fff;
  border: 1px solid rgba(238, 244, 255, 0.14);
  background: rgba(238, 244, 255, 0.09);
  border-radius: 16px;
}

.feedback-aaa-body .feedback-metrics strong {
  color: #fff;
}

.feedback-aaa-body .latest-feedback p {
  color: rgba(248, 251, 255, 0.82);
}

.feedback-aaa-body .feedback-meta-row {
  color: rgba(248, 251, 255, 0.62);
}

.feedback-aaa-body .feedback-details summary {
  color: #6bc8ff;
}

.feedback-aaa-body .feedback-table th,
.feedback-aaa-body .feedback-table td {
  border-bottom: 1px solid rgba(238, 244, 255, 0.12);
  color: rgba(248, 251, 255, 0.82);
}

.feedback-aaa-body .feedback-table th {
  background: rgba(238, 244, 255, 0.08);
  color: #fff;
}

.feedback-aaa-body .feedback-action,
.feedback-aaa-body .feedback-action.reviewed,
.feedback-aaa-body .feedback-action.needs-update,
.feedback-aaa-body .feedback-action.ignored {
  color: #fff;
  border: 1px solid rgba(171, 190, 255, 0.28);
  background: rgba(7, 11, 35, 0.35);
  box-shadow: 0 0 18px rgba(28, 119, 255, 0.10);
}

.feedback-aaa-body .feedback-action:hover {
  background: rgba(79, 92, 255, 0.18);
}

.feedback-aaa-body .feedback-action.create-entry {
  border-color: rgba(54, 169, 255, 0.62);
  background: linear-gradient(100deg, #166fff, #5c55ff 52%, #bd35ff);
  box-shadow: 0 12px 28px rgba(23, 105, 255, 0.22), 0 0 24px rgba(190, 55, 255, 0.18);
}

.feedback-aaa-body .empty-state {
  color: rgba(248, 251, 255, 0.72);
  border: 1px dashed rgba(223, 232, 255, 0.28);
  background: rgba(238, 244, 255, 0.08);
  border-radius: 18px;
}

@media (max-width: 1220px) {
  .aaa-summary-grid,
  .feedback-summary-grid.aaa-summary-grid,
  .analytics-summary-grid.aaa-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aaa-feedback-analytics-grid,
  .analytics-grid.aaa-feedback-analytics-grid,
  .aaa-feedback-filters,
  .filters-row.aaa-feedback-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .feedback-aaa-body .aaa-topbar-actions {
    gap: 10px;
  }

  .feedback-aaa-body .aaa-refresh-top {
    min-width: 0;
    padding: 0 16px;
  }

  .aaa-summary-grid,
  .feedback-summary-grid.aaa-summary-grid,
  .analytics-summary-grid.aaa-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   FINAL OVERRIDE: LIGHT FEEDBACK UI ALIGNMENT
   Keeps Feedback & Analytics consistent with the light admin menus.
   ========================================================= */
.feedback-aaa-body .aaa-analytics-tabs,
.feedback-aaa-body .aaa-glass-panel,
.feedback-aaa-body .analytics-panel.aaa-glass-panel,
.feedback-aaa-body .aaa-association-suggestions-panel,
.feedback-aaa-body .feedback-topic-card,
.feedback-aaa-body .summary-card,
.feedback-aaa-body .analytics-feedback-card {
  color: var(--aaa-ink) !important;
  background:
    radial-gradient(circle at 92% 10%, rgba(106, 77, 245, 0.075), transparent 30%),
    radial-gradient(circle at 12% 0%, rgba(79, 125, 243, 0.055), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #f8f9fd 100%) !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.075) !important;
}

.feedback-aaa-body .aaa-section-header-mini h2,
.feedback-aaa-body .analytics-section-header.aaa-section-header-mini h2,
.feedback-aaa-body .analytics-panel-header h2,
.feedback-aaa-body .feedback-topic-header h2,
.feedback-aaa-body .card-title,
.feedback-aaa-body .summary-card strong,
.feedback-aaa-body .analytics-row strong,
.feedback-aaa-body .analytics-feedback-top strong,
.feedback-aaa-body .feedback-metrics strong,
.feedback-aaa-body .latest-feedback p,
.feedback-aaa-body .association-suggestion-row strong {
  color: var(--aaa-ink) !important;
  text-shadow: none !important;
}

.feedback-aaa-body .aaa-section-header-mini p,
.feedback-aaa-body .analytics-section-header.aaa-section-header-mini p,
.feedback-aaa-body .analytics-panel-header p,
.feedback-aaa-body .summary-card span,
.feedback-aaa-body .analytics-row span,
.feedback-aaa-body .analytics-feedback-top span,
.feedback-aaa-body .analytics-feedback-card p,
.feedback-aaa-body .topic-label,
.feedback-aaa-body .feedback-metrics span,
.feedback-aaa-body .feedback-meta-row,
.feedback-aaa-body .association-suggestion-row span {
  color: var(--aaa-muted) !important;
}

.feedback-aaa-body .aaa-tab-buttons,
.feedback-aaa-body .analytics-tab-buttons.aaa-tab-buttons {
  background: #e9edf6 !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: none !important;
}

.feedback-aaa-body .aaa-tab-buttons .analytics-tab-btn,
.feedback-aaa-body .analytics-tab-buttons.aaa-tab-buttons .analytics-tab-btn {
  color: #4f5b70 !important;
}

.feedback-aaa-body .aaa-tab-buttons .analytics-tab-btn.active,
.feedback-aaa-body .analytics-tab-buttons.aaa-tab-buttons .analytics-tab-btn.active {
  color: #ffffff !important;
  background: linear-gradient(180deg, #7357ee 0%, #6245dc 100%) !important;
  box-shadow: 0 10px 22px rgba(98, 69, 220, 0.20) !important;
}

.feedback-aaa-body .analytics-row,
.feedback-aaa-body .association-suggestion-row,
.feedback-aaa-body .feedback-metrics div,
.feedback-aaa-body .latest-feedback,
.feedback-aaa-body .empty-state {
  color: var(--aaa-ink) !important;
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: var(--aaa-shadow-sm) !important;
}

.feedback-aaa-body .association-suggestion-row {
  min-height: 82px;
  padding: 14px 16px;
}

.feedback-aaa-body .feedback-action,
.feedback-aaa-body .feedback-action.reviewed,
.feedback-aaa-body .feedback-action.needs-update,
.feedback-aaa-body .feedback-action.ignored {
  color: #1f2937 !important;
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: var(--aaa-shadow-sm) !important;
}

.feedback-aaa-body .feedback-action:hover {
  background: #f3f5fa !important;
  color: #1f2937 !important;
}

.feedback-aaa-body .feedback-action.create-entry,
.feedback-aaa-body .approve-association-suggestion-btn {
  color: #ffffff !important;
  background: linear-gradient(180deg, #7357ee 0%, #6245dc 100%) !important;
  border: 0 !important;
  box-shadow: 0 10px 22px rgba(98, 69, 220, 0.20) !important;
}

.feedback-aaa-body .topic-status {
  color: #155e46 !important;
  background: #eaf8f1 !important;
  border-color: #bee8d3 !important;
}

.feedback-aaa-body .topic-status.needs-review,
.feedback-aaa-body .summary-card.danger strong {
  color: #b42335 !important;
}

.feedback-aaa-body .topic-status.needs-review {
  background: #fff5f6 !important;
  border-color: #efc6cc !important;
}

.feedback-aaa-body .feedback-table th {
  color: #374151 !important;
  background: #f3f5fa !important;
}

.feedback-aaa-body .feedback-table td {
  color: var(--aaa-ink) !important;
  background: #ffffff !important;
  border-bottom: 1px solid var(--aaa-line) !important;
}

/* =========================================================
   FINAL OVERRIDE: Suggested Topic Associations row contrast
   Uses the same light alternating row treatment as admin tables.
   ========================================================= */
.feedback-aaa-body #associationSuggestionsList {
  gap: 0 !important;
  border: 1px solid #c7d2e3 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  background: #ffffff !important;
  box-shadow: 0 10px 24px rgba(31, 42, 74, 0.055) !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row,
.feedback-aaa-body #associationSuggestionsList .analytics-row.association-suggestion-row {
  min-height: 76px !important;
  margin: 0 !important;
  padding: 14px 18px !important;
  border: 0 !important;
  border-bottom: 1px solid #d4dce8 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #1f2937 !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:last-child {
  border-bottom: 0 !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:nth-of-type(odd) {
  background: #ffffff !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:nth-of-type(even) {
  background: #f2f5fa !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:hover,
.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:nth-of-type(odd):hover,
.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:nth-of-type(even):hover {
  background: #eaf0fb !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row strong {
  color: #0f172a !important;
  font-weight: 600 !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row span {
  color: #344054 !important;
  font-weight: 500 !important;
}

.feedback-aaa-body #associationSuggestionsList .approve-association-suggestion-btn {
  color: #ffffff !important;
  background: linear-gradient(180deg, #7357ee 0%, #6245dc 100%) !important;
  border: 0 !important;
  box-shadow: 0 8px 18px rgba(98, 69, 220, 0.18) !important;
}

/* =========================================================
   FINAL OVERRIDE: Softer Suggested Topic Association rows
   Matches the softer row rhythm used in Knowledge Manager.
   ========================================================= */
.feedback-aaa-body #associationSuggestionsList {
  border-color: #d4dce8 !important;
  background: #ffffff !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row,
.feedback-aaa-body #associationSuggestionsList .analytics-row.association-suggestion-row {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #253044 !important;
  font-weight: 400 !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:nth-of-type(odd) {
  background: #ffffff !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:nth-of-type(even) {
  background: #f8fafc !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:hover,
.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:nth-of-type(odd):hover,
.feedback-aaa-body #associationSuggestionsList .association-suggestion-row:nth-of-type(even):hover {
  background: #f2f6fb !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row strong {
  color: #111827 !important;
  font-weight: 600 !important;
}

.feedback-aaa-body #associationSuggestionsList .association-suggestion-row span {
  color: #4b5563 !important;
  font-weight: 400 !important;
}

.feedback-aaa-body #associationSuggestionsList .approve-association-suggestion-btn {
  font-weight: 500 !important;
}

/* =========================================================
   FINAL OVERRIDE: Top Question Topic rating colors
   Helpful uses confirmation green; not-helpful uses soft red.
   ========================================================= */
.feedback-aaa-body #topTopicsList .analytics-row-stat,
.feedback-aaa-body #topTopicsList .analytics-row-stat.is-positive,
.feedback-aaa-body #topTopicsList .analytics-row-stat.is-negative {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 30px !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

.feedback-aaa-body #topTopicsList .analytics-row-stat.is-positive {
  color: #166534 !important;
  -webkit-text-fill-color: #166534 !important;
  background: #ecfdf3 !important;
  border: 1px solid #bbf7d0 !important;
}

.feedback-aaa-body #topTopicsList .analytics-row-stat.is-negative {
  color: #b42318 !important;
  -webkit-text-fill-color: #b42318 !important;
  background: #fff7f7 !important;
  border: 1px solid #fecaca !important;
}


/* ==========================================================================
   Inquiry history
   Source: styles-src/60-history.css
   ========================================================================== */
.inquiry-audit-page .inquiry-filters {
  grid-template-columns: minmax(260px, 1.8fr) minmax(180px, 0.8fr) minmax(170px, 0.7fr);
}

.inquiry-status {
  min-height: 22px;
  margin: 8px 0 12px;
  color: rgba(219, 227, 255, 0.78);
  font-weight: 600;
}

.inquiry-status.error {
  color: #ffb4b4;
}

.inquiry-toolbar .aaa-view-actions {
  align-items: center;
}

.inquiry-sort-label {
  color: rgba(219, 227, 255, 0.72);
  font-weight: 700;
}

.inquiry-sort-select {
  min-width: 165px;
}

.inquiry-table-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inquiry-table-header,
.inquiry-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(170px, 0.9fr) minmax(140px, 0.7fr) minmax(260px, 1.7fr) minmax(90px, 0.45fr) minmax(150px, 0.65fr);
  gap: 12px;
  align-items: center;
}

.inquiry-table-header {
  padding: 12px 16px;
  color: rgba(219, 227, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.inquiry-row {
  padding: 16px;
  border: 1px solid rgba(132, 157, 255, 0.28);
  border-radius: 18px;
  color: #ffffff;
  background:
    radial-gradient(circle at 9% 18%, rgba(31, 119, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(18, 24, 62, 0.78), rgba(8, 12, 42, 0.82));
  box-shadow: 0 16px 42px rgba(0,0,0,0.19), 0 0 0 1px rgba(255,255,255,0.025) inset;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.inquiry-row.saved {
  border-color: rgba(255, 197, 84, 0.5);
  box-shadow: 0 16px 42px rgba(0,0,0,0.19), 0 0 24px rgba(255, 197, 84, 0.08) inset;
}

.inquiry-row strong {
  display: block;
  color: #ffffff;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inquiry-row span,
.inquiry-row small {
  display: block;
  color: rgba(219, 227, 255, 0.72);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inquiry-preview-cell strong {
  margin-bottom: 4px;
}

.inquiry-save-pill {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  color: rgba(219, 227, 255, 0.76) !important;
  background: rgba(238, 244, 255, 0.08);
  border: 1px solid rgba(238, 244, 255, 0.10);
  font-size: 12px;
  font-weight: 700;
}

.inquiry-save-pill.active {
  color: #3b2400 !important;
  background: linear-gradient(135deg, #ffd36d, #ffb21f);
  border-color: rgba(255, 218, 128, 0.75);
}

.inquiry-action-cell {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.inquiry-detail-panel {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(238, 244, 255, 0.12);
}

.inquiry-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px;
}

.inquiry-detail-grid section {
  padding: 14px;
  border-radius: 16px;
  background: rgba(238, 244, 255, 0.055);
  border: 1px solid rgba(238, 244, 255, 0.08);
}

.inquiry-detail-grid h3 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 14px;
}

.inquiry-detail-text {
  color: rgba(241, 245, 255, 0.9);
  line-height: 1.55;
  white-space: normal;
}

.inquiry-spacer {
  height: 8px;
}

.inquiry-reference-line {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  color: rgba(219, 227, 255, 0.78);
}

.inquiry-reference-line strong {
  flex: 0 0 auto;
}

.aaa-inquiry-corner-btn {
  right: 78px;
}

@media (max-width: 1100px) {
  .inquiry-table-header {
    display: none;
  }

  .inquiry-row {
    grid-template-columns: 1fr;
  }

  .inquiry-action-cell {
    justify-content: flex-start;
  }

  .inquiry-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .inquiry-audit-page .inquiry-filters {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   FINAL OVERRIDE: LIGHT HISTORY UI ALIGNMENT
   Keeps History consistent with the light admin menus.
   ========================================================= */
.inquiry-audit-page .inquiry-status,
.inquiry-audit-page .inquiry-sort-label {
  color: var(--aaa-muted) !important;
}

.inquiry-audit-page .inquiry-table-shell {
  gap: 0 !important;
  border: 1px solid var(--aaa-line) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  background: #ffffff !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.075) !important;
}

.inquiry-audit-page .inquiry-table-header {
  color: #374151 !important;
  background: #f3f5fa !important;
  border-bottom: 1px solid var(--aaa-line) !important;
}

.inquiry-audit-page .inquiry-row {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--aaa-ink) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--aaa-line) !important;
}

.inquiry-audit-page .inquiry-row:nth-child(odd) {
  background: #fbfcff !important;
}

.inquiry-audit-page .inquiry-row:nth-child(even) {
  background: #f6f8fc !important;
}

.inquiry-audit-page .inquiry-row:hover {
  background: #eef3ff !important;
}

.inquiry-audit-page .inquiry-row.saved {
  background: #fffdf5 !important;
  box-shadow: inset 4px 0 0 #f2b84b !important;
}

.inquiry-audit-page .inquiry-row strong,
.inquiry-audit-page .inquiry-detail-grid h3,
.inquiry-audit-page .inquiry-detail-text {
  color: var(--aaa-ink) !important;
}

.inquiry-audit-page .inquiry-row span,
.inquiry-audit-page .inquiry-row small,
.inquiry-audit-page .inquiry-reference-line {
  color: var(--aaa-muted) !important;
}

.inquiry-audit-page .inquiry-detail-panel {
  border-top: 1px solid var(--aaa-line) !important;
}

.inquiry-audit-page .inquiry-detail-grid section {
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: var(--aaa-shadow-sm) !important;
}

.inquiry-audit-page .inquiry-save-pill {
  color: #4f5b70 !important;
  background: #f3f5fa !important;
  border: 1px solid var(--aaa-line) !important;
}

.inquiry-audit-page .inquiry-save-pill.active {
  color: #5b3900 !important;
  background: #fff7dd !important;
  border-color: #f4daa2 !important;
}


/* ==========================================================================
   Security settings
   Source: styles-src/70-security.css
   ========================================================================== */
.security-page {
  gap: 18px;
}

.security-page-header {
  align-items: center;
}

.security-status {
  min-height: 22px;
  color: var(--aaa-muted);
  font-weight: 700;
}

.security-status.error {
  color: #fecaca;
}

.security-status.success {
  color: #bbf7d0;
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.security-card {
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(15,23,42,.88), rgba(15,23,42,.72));
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
  display: grid;
  gap: 12px;
}

.security-card h2 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 19px;
}

.security-card p {
  margin: 4px 0 0;
  color: var(--aaa-muted);
}

.security-card label {
  color: rgba(248, 251, 255, 0.92);
  font-weight: 600;
  font-size: 14px;
}

.security-card select,
.security-card input[type="number"],
.security-modal input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(15,23,42,.72);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
}

.security-card select option {
  background: #0f172a;
  color: #fff;
}

.security-inline-fields {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 10px;
  align-items: center;
}

.security-inline-fields span {
  color: var(--aaa-muted);
  font-weight: 700;
}

.security-checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.security-checkline input {
  width: 17px;
  height: 17px;
  accent-color: var(--aaa-blue);
}

.security-card-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.security-readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.security-readiness-box {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.security-readiness-box strong {
  color: #fff;
}

.security-readiness-box span,
.security-readiness-box li {
  color: var(--aaa-muted);
  font-size: 13px;
}

.security-readiness-box ul {
  margin: 0;
  padding-left: 18px;
}

.security-ready-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(34,197,94,.25);
  background: rgba(34,197,94,.13);
  color: #86efac;
}

.security-ready-pill.warn {
  border-color: rgba(245,158,11,.28);
  background: rgba(245,158,11,.14);
  color: #fde68a;
}

.security-overlay[hidden] {
  display: none;
}

.security-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 120;
}

.security-modal {
  width: min(620px, 100%);
  max-height: 92vh;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.security-fix-modal {
  width: min(760px, 100%);
}

.security-modal-header,
.security-modal-actions {
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.security-modal-actions {
  border-top: 1px solid #e5e7eb;
  border-bottom: none;
  justify-content: flex-end;
}

.security-modal-header h2 {
  margin: 0;
  color: #111827;
}

.security-modal-header p {
  margin: 6px 0 0;
  color: #6b7280;
}

.security-modal-body {
  padding: 22px;
  display: grid;
  gap: 10px;
  overflow: auto;
}

.security-modal-body label {
  color: #374151;
  font-weight: 600;
  font-size: 14px;
}

.security-modal-body label span {
  color: #6b7280;
  font-weight: 600;
}

.security-modal input {
  background: #fff;
  color: #111827;
  border-color: #dbe2ea;
}

.security-modal-status {
  min-height: 22px;
  color: #4b5563;
  font-weight: 700;
}

.security-modal-status.error {
  color: #dc2626;
}

.security-modal-status.success {
  color: #047857;
}

.security-guardrail-details {
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 14px;
  padding: 14px;
  color: #374151;
  line-height: 1.5;
}

.security-mfa-section {
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.security-mfa-section[hidden] {
  display: none;
}

.security-mfa-box {
  display: grid;
  gap: 10px;
}

.security-mfa-box img {
  width: 190px;
  height: 190px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
}

.security-mfa-secret {
  display: grid;
  gap: 4px;
  color: #4b5563;
  font-size: 13px;
}

.security-mfa-secret code {
  color: #111827;
  word-break: break-all;
}

@media (max-width: 900px) {
  .security-grid,
  .security-readiness-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   FINAL OVERRIDE: LIGHT SECURITY UI ALIGNMENT
   Keeps Security & Login Settings consistent with the light admin menus.
   ========================================================= */
.security-page .security-card,
.security-page .security-readiness-box {
  color: var(--aaa-ink) !important;
  background:
    radial-gradient(circle at 92% 10%, rgba(106, 77, 245, 0.065), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #f8f9fd 100%) !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: 0 14px 34px rgba(31, 42, 74, 0.075) !important;
}

.security-page .security-card h2,
.security-page .security-readiness-box strong,
.security-page .security-card label,
.security-page .security-checkline,
.security-page .security-checkline span {
  color: var(--aaa-ink) !important;
}

.security-page .security-card p,
.security-page .security-inline-fields span,
.security-page .security-status,
.security-page .security-readiness-box span,
.security-page .security-readiness-box li {
  color: var(--aaa-muted) !important;
}

.security-page .security-card select,
.security-page .security-card input[type="number"] {
  color: #1f2937 !important;
  -webkit-text-fill-color: #1f2937 !important;
  background: #ffffff !important;
  border: 1px solid var(--aaa-line) !important;
  box-shadow: var(--aaa-shadow-sm) !important;
}

.security-page .security-card select option {
  color: #1f2937 !important;
  background: #ffffff !important;
}

.security-page .security-ready-pill {
  color: #155e46 !important;
  background: #eaf8f1 !important;
  border-color: #bee8d3 !important;
}

.security-page .security-ready-pill.warn {
  color: #7a4b00 !important;
  background: #fff7dd !important;
  border-color: #f4daa2 !important;
}

.security-page .security-status.success {
  color: #047857 !important;
}

.security-page .security-status.error {
  color: #b42335 !important;
}


/* ==========================================================================
   Mobile, native controls and accessibility
   Source: styles-src/90-mobile.css
   ========================================================================== */
/* InstInt mobile resilience layer — loaded last on every page.
   Keeps iPhone Safari safe areas, scrolling, navigation and dialogs predictable. */

:root {
  --mobile-safe-top: env(safe-area-inset-top, 0px);
  --mobile-safe-right: env(safe-area-inset-right, 0px);
  --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-safe-left: env(safe-area-inset-left, 0px);
}

html {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  max-width: 100%;
  overflow-wrap: anywhere;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

/* Never show the obsolete horizontal-toolbar affordances. */
.aaa-toolbar-scroll-peek,
.aaa-toolbar-edge-fade,
.aaa-mobile-toolbar-fade {
  display: none !important;
  pointer-events: none !important;
}

.admin-aaa-body .aaa-sidebar::before,
.admin-aaa-body .aaa-sidebar::after,
.admin-aaa-body .aaa-sidebar-nav::after {
  content: none !important;
  display: none !important;
}

@supports (height: 100dvh) {
  .mobile-panel,
  .duplicate-overlay,
  .security-overlay,
  .role-security-overlay,
  .knowledge-editor-panel,
  .draft-editor-panel {
    --mobile-viewport-height: 100dvh;
  }
}

@media (max-width: 1040px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .site-header {
    padding-top: var(--mobile-safe-top);
  }

  .mobile-panel {
    top: calc(var(--header-h) + var(--mobile-safe-top)) !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    max-height: calc(100dvh - var(--header-h) - var(--mobile-safe-top)) !important;
    overflow: hidden !important;
    overscroll-behavior: contain;
  }

  .mobile-panel.open {
    overflow-y: auto !important;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-panel-inner {
    min-height: 0;
    overflow: visible !important;
  }

  .mobile-nav {
    padding-bottom: calc(22px + var(--mobile-safe-bottom)) !important;
  }

  .mobile-nav a,
  .menu-toggle,
  .mobile-actions .btn {
    min-height: 44px;
  }
}

@media (max-width: 760px) {
  /* Preserve the full brand wordmark instead of collapsing to a floating bolt. */
  .site-header .brand.brand-official .brand-logo-full {
    display: block !important;
    width: clamp(112px, 34vw, 146px) !important;
    height: auto !important;
    max-height: 54px !important;
  }

  .site-header .brand.brand-official .brand-logo-icon {
    display: none !important;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  button,
  [role="button"],
  input[type="button"],
  input[type="submit"],
  input[type="reset"] {
    min-height: 44px;
  }

  .modal-backdrop {
    padding-top: var(--mobile-safe-top) !important;
    padding-right: var(--mobile-safe-right) !important;
    padding-left: var(--mobile-safe-left) !important;
  }

  .modal {
    max-height: calc(100dvh - var(--mobile-safe-top)) !important;
    padding-bottom: var(--mobile-safe-bottom);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Admin navigation: one sticky dropdown, never a swipe bar or second floating bar. */
@media (max-width: 900px) {
  body.admin-aaa-body {
    padding-top: 0 !important;
    padding-right: var(--mobile-safe-right) !important;
    padding-left: var(--mobile-safe-left) !important;
    overflow-x: hidden !important;
  }

  body.admin-aaa-body.aaa-mobile-nav-is-open {
    overflow: hidden !important;
  }

  .admin-aaa-body .admin-aaa-shell,
  .admin-aaa-body .aaa-admin-shell,
  .admin-aaa-body .admin-shell,
  .admin-aaa-body .dashboard-shell {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .admin-aaa-body .aaa-sidebar,
  .admin-aaa-body aside.aaa-sidebar {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    z-index: 9000 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: calc(68px + var(--mobile-safe-top)) !important;
    min-height: calc(68px + var(--mobile-safe-top)) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: calc(10px + var(--mobile-safe-top)) 12px 10px !important;
    overflow: visible !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(157, 177, 255, 0.25) !important;
    border-radius: 0 !important;
    background: linear-gradient(180deg, rgba(7, 13, 40, 0.99), rgba(3, 7, 25, 0.99)) !important;
    box-shadow: 0 7px 24px rgba(15, 23, 42, 0.18) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open {
    height: calc(68px + var(--mobile-safe-top)) !important;
    min-height: calc(68px + var(--mobile-safe-top)) !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .admin-aaa-body .aaa-logo-link,
  .admin-aaa-body .sidebar-logo-link.aaa-logo-link,
  .admin-aaa-body .aaa-sidebar-bottom-link,
  .admin-aaa-body .sidebar-bottom-link.aaa-nav-link,
  .admin-aaa-body .aaa-admin-link {
    display: none !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle {
    position: relative !important;
    inset: auto !important;
    z-index: 2 !important;
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) 24px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 0 13px !important;
    gap: 10px !important;
    border: 1px solid rgba(182, 202, 255, 0.26) !important;
    border-radius: 12px !important;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
    text-align: left !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle:focus-visible {
    outline: 3px solid #9fc6ff !important;
    outline-offset: 2px !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle-icon,
  .admin-aaa-body .aaa-mobile-nav-toggle-chevron {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle-text {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .admin-aaa-body .aaa-mobile-nav-toggle-chevron {
    transform: rotate(0deg) !important;
    transition: transform 160ms ease !important;
  }

  .admin-aaa-body .aaa-mobile-nav-open .aaa-mobile-nav-toggle-chevron {
    transform: rotate(180deg) !important;
  }

  .admin-aaa-body .aaa-sidebar-nav,
  .admin-aaa-body .sidebar-nav.aaa-sidebar-nav {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    z-index: 8999 !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    max-height: calc(100dvh - 76px - var(--mobile-safe-top) - var(--mobile-safe-bottom)) !important;
    margin: 0 !important;
    padding: 8px 8px calc(8px + var(--mobile-safe-bottom)) !important;
    gap: 4px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(182, 202, 255, 0.24) !important;
    touch-action: pan-y;
    border-radius: 0 0 14px 14px !important;
    background: rgba(5, 10, 31, 0.99) !important;
    box-shadow: 0 22px 48px rgba(9, 16, 40, 0.38) !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .admin-aaa-body .aaa-sidebar.aaa-mobile-nav-open .aaa-sidebar-nav,
  .admin-aaa-body.aaa-mobile-nav-is-open .aaa-sidebar .aaa-sidebar-nav {
    display: flex !important;
  }

  .admin-aaa-body .aaa-sidebar-nav .aaa-nav-link,
  .admin-aaa-body .aaa-sidebar-nav .sidebar-link.aaa-nav-link {
    position: static !important;
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 10px 13px !important;
    gap: 12px !important;
    border-radius: 10px !important;
    color: rgba(247, 250, 255, 0.92) !important;
    text-decoration: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .admin-aaa-body .aaa-sidebar-nav .aaa-nav-link[style*="display: none"] {
    display: none !important;
  }

  .admin-aaa-body .aaa-sidebar-nav .aaa-nav-link svg {
    display: block !important;
    flex: 0 0 22px !important;
    width: 22px !important;
    height: 22px !important;
    stroke: currentColor !important;
  }

  .admin-aaa-body .aaa-sidebar-nav .aaa-nav-link span {
    display: block !important;
    min-width: 0 !important;
    overflow: visible !important;
    font-size: 15px !important;
    font-weight: 650 !important;
    line-height: 1.25 !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .admin-aaa-body .aaa-topbar,
  .admin-aaa-body .topbar.aaa-topbar {
    position: relative !important;
    inset: auto !important;
    z-index: 20 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 62px !important;
    margin: 0 !important;
    padding: 9px 12px !important;
    gap: 10px !important;
    transform: none !important;
  }

  .admin-aaa-body .aaa-topbar-actions {
    display: flex !important;
    min-width: 0 !important;
    margin-left: auto !important;
    gap: 8px !important;
  }

  .admin-aaa-body .aaa-topbar-actions button,
  .admin-aaa-body .aaa-topbar-actions a {
    min-height: 44px !important;
  }

  .admin-aaa-body .aaa-main-shell,
  .admin-aaa-body .main-shell.aaa-main-shell,
  .admin-aaa-body .aaa-content-shell,
  .admin-aaa-body .content-shell.aaa-content-shell,
  .admin-aaa-body .aaa-content-area,
  .admin-aaa-body .content-area.aaa-content-area {
    min-width: 0 !important;
    width: 100% !important;
    margin-left: 0 !important;
    transform: none !important;
  }

  .admin-aaa-body .aaa-content-area,
  .admin-aaa-body .content-area.aaa-content-area {
    padding: 22px 14px calc(38px + var(--mobile-safe-bottom)) !important;
  }

  .admin-aaa-body .aaa-content-header,
  .admin-aaa-body .content-header.aaa-content-header,
  .admin-aaa-body .aaa-view-toolbar,
  .admin-aaa-body .aaa-view-actions,
  .admin-aaa-body .bulk-actions-bar,
  .admin-aaa-body .bulk-left,
  .admin-aaa-body .bulk-right {
    min-width: 0 !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
  }

  .admin-aaa-body .aaa-view-actions {
    overflow-x: visible !important;
  }

  .admin-aaa-body .aaa-knowledge-table-shell,
  .admin-aaa-body .table-shell,
  .admin-aaa-body .table-responsive,
  .admin-aaa-body .history-table-wrap,
  .admin-aaa-body .roles-table-wrap,
  .admin-aaa-body .security-table-wrap {
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* Dialogs and editor sheets: one scroll container with permanently reachable actions. */
@media (max-width: 900px) {
  body.mobile-modal-open {
    overflow: hidden !important;
  }

  .admin-aaa-body .duplicate-overlay,
  .admin-aaa-body .aaa-duplicate-overlay,
  .admin-aaa-body .security-overlay,
  .admin-aaa-body .role-security-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 20000 !important;
    width: 100% !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: calc(6px + var(--mobile-safe-top)) calc(6px + var(--mobile-safe-right)) calc(6px + var(--mobile-safe-bottom)) calc(6px + var(--mobile-safe-left)) !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .admin-aaa-body .duplicate-overlay.open,
  .admin-aaa-body .aaa-duplicate-overlay.open,
  .admin-aaa-body .security-overlay:not([hidden]),
  .admin-aaa-body .role-security-overlay:not([hidden]) {
    display: flex !important;
  }

  .admin-aaa-body .duplicate-modal,
  .admin-aaa-body .aaa-duplicate-overlay .duplicate-modal,
  .admin-aaa-body .security-modal,
  .admin-aaa-body .role-security-modal {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 16px !important;
  }

  .admin-aaa-body .duplicate-header,
  .admin-aaa-body .security-modal-header,
  .admin-aaa-body .role-security-modal-header {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    padding: 14px !important;
    gap: 10px !important;
  }

  .admin-aaa-body .duplicate-header > div,
  .admin-aaa-body .security-modal-header > div,
  .admin-aaa-body .role-security-modal-header > div {
    min-width: 0 !important;
  }

  .admin-aaa-body .duplicate-header h2,
  .admin-aaa-body .security-modal-header h2,
  .admin-aaa-body .role-security-modal-header h2 {
    font-size: clamp(20px, 5.7vw, 25px) !important;
    line-height: 1.15 !important;
  }

  .admin-aaa-body .duplicate-header .icon-btn,
  .admin-aaa-body .security-modal-header .icon-btn,
  .admin-aaa-body .role-security-modal-header .icon-btn {
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  .admin-aaa-body .duplicate-body,
  .admin-aaa-body .security-modal-body,
  .admin-aaa-body .role-security-modal-body {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .admin-aaa-body .duplicate-column {
    min-width: 0 !important;
    padding: 14px !important;
  }

  .admin-aaa-body .duplicate-content,
  .admin-aaa-body .duplicate-list {
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .admin-aaa-body .security-modal-body,
  .admin-aaa-body .role-security-modal-body {
    padding: 14px !important;
  }

  .admin-aaa-body .duplicate-actions,
  .admin-aaa-body .security-modal-actions,
  .admin-aaa-body .role-security-modal-actions {
    position: relative !important;
    inset: auto !important;
    z-index: 3 !important;
    display: grid !important;
    flex: 0 0 auto !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    min-width: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  .admin-aaa-body .duplicate-actions button,
  .admin-aaa-body .security-modal-actions button,
  .admin-aaa-body .role-security-modal-actions button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    height: auto !important;
    margin: 0 !important;
    white-space: normal !important;
  }

  .admin-aaa-body .knowledge-editor-panel.aaa-editor-panel,
  .admin-aaa-body #editorPanel.knowledge-editor-panel,
  .admin-aaa-body #rolePanel.knowledge-editor-panel,
  .admin-aaa-body .draft-editor-panel,
  .admin-aaa-body .aaa-draft-editor-panel {
    position: fixed !important;
    inset: 0 !important;
    z-index: 19000 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: var(--mobile-safe-top) var(--mobile-safe-right) var(--mobile-safe-bottom) var(--mobile-safe-left) !important;
    overflow: hidden !important;
    border-radius: 0 !important;
  }

  .admin-aaa-body .knowledge-editor-panel.aaa-editor-panel.open,
  .admin-aaa-body .draft-editor-panel.open,
  .admin-aaa-body .aaa-draft-editor-panel.open {
    display: flex !important;
    flex-direction: column !important;
  }

  .admin-aaa-body .draft-editor-panel .panel-shell,
  .admin-aaa-body .aaa-draft-editor-panel .panel-shell {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 0 !important;
  }

  .admin-aaa-body .knowledge-editor-panel > .panel-header,
  .admin-aaa-body .draft-editor-panel .panel-header {
    flex: 0 0 auto !important;
    padding: 13px 14px !important;
  }

  .admin-aaa-body .knowledge-editor-panel > .panel-body,
  .admin-aaa-body .draft-editor-panel .panel-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .admin-aaa-body .knowledge-editor-panel .panel-actions,
  .admin-aaa-body .draft-editor-panel .panel-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .admin-aaa-body .knowledge-editor-panel .panel-actions button,
  .admin-aaa-body .draft-editor-panel .panel-actions button,
  .admin-aaa-body .draft-editor-panel .approve-wide-btn {
    width: 100% !important;
    min-height: 48px !important;
  }
}

@media (max-width: 430px) {
  .site-header .header-inner {
    gap: 6px;
  }

  .site-header .header-actions .btn-secondary {
    min-width: 44px;
    padding-inline: 8px;
  }

  .admin-aaa-body .aaa-topbar-title,
  .admin-aaa-body .aaa-topbar-branch-only {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .admin-aaa-body .aaa-sidebar-nav,
  .admin-aaa-body .sidebar-nav.aaa-sidebar-nav {
    max-height: calc(100dvh - 72px - var(--mobile-safe-top) - var(--mobile-safe-bottom)) !important;
  }

  .admin-aaa-body .duplicate-header p,
  .admin-aaa-body .security-modal-header p,
  .admin-aaa-body .role-security-modal-header p {
    display: none !important;
  }

  .admin-aaa-body .duplicate-header,
  .admin-aaa-body .duplicate-actions,
  .admin-aaa-body .security-modal-header,
  .admin-aaa-body .security-modal-actions,
  .admin-aaa-body .role-security-modal-header,
  .admin-aaa-body .role-security-modal-actions {
    padding-block: 7px !important;
  }
}

@media (max-width: 900px) {
  .admin-aaa-body #duplicateOverlay .duplicate-review-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .admin-aaa-body #duplicateOverlay .duplicate-review-scroll > .duplicate-body {
    display: block !important;
    flex: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .admin-aaa-body #duplicateOverlay .duplicate-matches-rollup {
    margin: 10px 12px 14px !important;
  }

  .admin-aaa-body #duplicateOverlay .duplicate-review-toolbar {
    flex: 0 0 auto !important;
    padding-bottom: calc(10px + var(--mobile-safe-bottom)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aaa-mobile-nav-toggle-chevron {
    transition: none !important;
  }
}

/* Native controls: consistent readable picker text in Android Chrome and iOS Safari. */
.admin-aaa-body {
  color-scheme: light;
}

.admin-aaa-body select,
.admin-aaa-body select:focus,
.admin-aaa-body input,
.admin-aaa-body textarea {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
  background-color: #ffffff !important;
}

.admin-aaa-body select,
.admin-aaa-body input:not([type="checkbox"]):not([type="radio"]),
.admin-aaa-body textarea,
.admin-aaa-body button,
.admin-aaa-body [role="button"] {
  min-height: 44px;
}

.admin-aaa-body select option,
.admin-aaa-body select optgroup {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
  background: #ffffff !important;
}

.admin-aaa-body select option:disabled {
  color: #667085 !important;
  -webkit-text-fill-color: #667085 !important;
  background: #f5f7fb !important;
}

/* Staff app: preserve context, branding, safe areas and reliable touch targets. */
.staff-header {
  padding-top: var(--mobile-safe-top);
  padding-right: var(--mobile-safe-right);
  padding-left: var(--mobile-safe-left);
}

.staff-main {
  padding-right: var(--mobile-safe-right);
  padding-bottom: calc(72px + var(--mobile-safe-bottom));
  padding-left: var(--mobile-safe-left);
}

.staff-button,
.feedback-button,
.ask-submit,
.question-pill {
  min-height: 44px !important;
}

.answer-panel {
  scroll-margin-top: calc(84px + var(--mobile-safe-top));
}

@media (max-width: 900px) {
  .staff-brand {
    gap: 8px !important;
  }

  .staff-brand img {
    width: 28px !important;
    height: 38px !important;
  }

  .staff-brand span {
    display: inline !important;
    font-size: 16px;
  }

  .staff-context {
    display: block !important;
    max-width: min(34vw, 220px);
    padding-left: 9px !important;
  }

  .staff-context span {
    display: block !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .staff-button.history {
    display: inline-flex !important;
  }

  body.aaa-staff-history-mode .aaa-admin-link {
    display: none !important;
  }

  .staff-header-inner {
    width: calc(100% - 20px) !important;
    min-height: 62px !important;
  }
}

@media (max-width: 430px) {
  .staff-context {
    max-width: 34vw;
    border-left: 0;
  }

  .staff-context strong {
    display: none;
  }

  .staff-button {
    padding-inline: 8px !important;
  }
}

/* Mobile admin layout: one attached menu and one compact action bar. */
@media (max-width: 900px) {
  .admin-aaa-body .aaa-sidebar-nav {
    max-height: calc(100dvh - 68px - var(--mobile-safe-top) - var(--mobile-safe-bottom)) !important;
  }

  .admin-aaa-body .aaa-topbar-brand,
  .admin-aaa-body .aaa-topbar-branch-only {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .admin-aaa-body .aaa-topbar-actions {
    flex: 0 0 auto !important;
  }

  .admin-aaa-body .knowledge-editor-panel > .panel-header,
  .admin-aaa-body .knowledge-editor-panel > .panel-body,
  .admin-aaa-body .draft-editor-panel .panel-header,
  .admin-aaa-body .draft-editor-panel .panel-body {
    width: 100% !important;
    max-width: none !important;
  }

  .admin-aaa-body #knowledgeAiOverlay .duplicate-content.aaa-ai-preview-content,
  .admin-aaa-body #knowledgeAiOverlay .duplicate-content,
  .admin-aaa-body #aiImproveOverlay .duplicate-content,
  .admin-aaa-body #duplicateOverlay .duplicate-content {
    max-height: none !important;
    overflow: visible !important;
  }

  .admin-aaa-body .aaa-merge-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 20000 !important;
    display: flex !important;
    width: 100% !important;
    height: 100dvh !important;
    padding: calc(6px + var(--mobile-safe-top)) calc(6px + var(--mobile-safe-right)) calc(6px + var(--mobile-safe-bottom)) calc(6px + var(--mobile-safe-left)) !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
  }

  .admin-aaa-body .aaa-merge-modal-overlay[hidden] {
    display: none !important;
  }

  .admin-aaa-body .aaa-merge-modal {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 16px !important;
  }

  .admin-aaa-body .aaa-merge-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .admin-aaa-body .aaa-merge-actions {
    flex: 0 0 auto !important;
    padding-bottom: calc(10px + var(--mobile-safe-bottom)) !important;
  }
}

@media (max-width: 430px) {
  .admin-aaa-body .aaa-topbar-brand,
  .admin-aaa-body .aaa-topbar-branch-only,
  .admin-aaa-body .aaa-icon-top {
    display: none !important;
  }

  .admin-aaa-body .aaa-topbar {
    justify-content: flex-end !important;
  }

  .admin-aaa-body .aaa-top-add,
  .admin-aaa-body .primary-btn.aaa-top-add {
    min-width: 0 !important;
    padding-inline: 14px !important;
  }
}

@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .admin-aaa-body .duplicate-actions,
  .admin-aaa-body .security-modal-actions,
  .admin-aaa-body .role-security-modal-actions,
  .admin-aaa-body .aaa-merge-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

