:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #172033;
  --muted: #68738a;
  --line: #e5eaf2;
  --primary: #1463ff;
  --primary-dark: #0d49bf;
  --error: #c62828;
  --error-bg: #ffe8e8;
  --warning: #a45f00;
  --warning-bg: #fff3d6;
  --info: #2156a5;
  --info-bg: #eaf1ff;
  --shadow: 0 14px 35px rgba(19, 36, 71, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: radial-gradient(circle at top left, #e9f0ff 0, transparent 34rem), var(--bg);
  color: var(--text);
}
a { color: inherit; }
code { background: #f0f4fb; border: 1px solid var(--line); padding: 2px 6px; border-radius: 8px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; text-decoration: none; font-size: 20px; }
.stage { color: var(--muted); margin-left: 12px; font-size: 14px; }
.pill { background: #eaf7ee; color: #136b31; padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.container { max-width: 1280px; margin: 0 auto; padding: 28px; }
.hero {
  padding: 28px 0 18px;
}
.hero.compact { padding-bottom: 10px; }
.hero h1 { font-size: 42px; line-height: 1.08; margin: 0 0 10px; letter-spacing: -.03em; }
.hero p { color: var(--muted); font-size: 17px; max-width: 850px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 18px 0;
}
.upload-card { max-width: 760px; }
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  border: 2px dashed #b7c6df;
  background: #fbfdff;
  border-radius: 18px;
  cursor: pointer;
  margin-bottom: 18px;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.dropzone:hover, .dropzone:focus-within, .dropzone.is-dragover {
  border-color: var(--primary);
  background: #eef5ff;
  box-shadow: 0 16px 36px rgba(37, 99, 235, .13);
}
.dropzone.is-dragover { transform: translateY(-1px); }
.drop-icon { font-size: 26px; margin-bottom: 8px; }
.drop-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; text-align: center; }
.drop-subtitle { color: var(--muted); text-align: center; }
.dropzone input { margin-top: 18px; }
.drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.drop-browse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .18);
}
.dropzone.is-dragover .drop-browse { background: var(--primary-dark); }
.drop-file-summary {
  display: inline-flex;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f2f6fc;
  color: var(--muted);
  font-size: 13px;
  max-width: 90%;
  text-align: center;
}
.drop-file-summary.has-files { background: #e9f8ef; color: #126b32; font-weight: 800; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 800;
  background: white;
  cursor: pointer;
}
.btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.small { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.note { color: var(--muted); font-size: 14px; }
.section-title-row { margin-top: 28px; }
.table-wrap { overflow-x: auto; background: white; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 840px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #44506a; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: #f8fafd; }
tr:last-child td { border-bottom: 0; }
.badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.badge.error { background: var(--error-bg); color: var(--error); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.info { background: var(--info-bg); color: var(--info); }
.error-text { color: var(--error); }
.warning-text { color: var(--warning); }
.muted { color: var(--muted); font-size: 13px; }
.evidence { color: #52460b; font-size: 12px; }
.empty {
  padding: 22px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.6);
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 12px 0 20px;
}
.summary-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.summary-card .big { font-size: 34px; font-weight: 900; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 20px; }
.filter-row { margin: 12px 0; }
.filter-row input {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-size: 15px;
}
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.file-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fbfdff;
}
.file-card h3 { margin-top: 0; overflow-wrap: anywhere; }
.issue-banner {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.issue-banner.error { background: var(--error-bg); color: #7c1616; }
.issue-banner.warning { background: var(--warning-bg); color: #704200; }
.issue-banner.info { background: var(--info-bg); color: #183f76; }
.pdf-viewer-wrap {
  width: 100%;
  overflow: auto;
  background: #1d2433;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.pdf-page {
  position: relative;
  margin: 0 auto;
  background: white;
}
.pdf-page img { display: block; width: 100%; height: auto; }
.highlight-box {
  position: absolute;
  border: 5px solid #ff2f2f;
  background: rgba(255, 47, 47, 0.18);
  box-shadow: 0 0 0 99999px rgba(0,0,0,.08), 0 0 18px rgba(255,47,47,.55);
  pointer-events: none;
  border-radius: 6px;
}
@media (max-width: 800px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 32px; }
  .topbar { align-items: flex-start; gap: 10px; flex-direction: column; }
}

/* Stage 1.1 layout improvements */
.container { max-width: 1500px; }
.upload-card.wide { max-width: 1040px; }
.big-btn { min-height: 50px; padding: 12px 20px; font-size: 16px; margin-top: 14px; }
.rules-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff, #ffffff);
  border-radius: 18px;
  padding: 18px;
  margin: 18px 0;
}
.rules-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}
.rules-header h2 { margin: 0 0 4px; }
.rules-header p { margin: 0; color: var(--muted); }
.severity-select { display: flex; flex-direction: column; gap: 6px; min-width: 150px; font-weight: 800; }
.severity-select select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: white;
}
.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.rule-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rule-title { font-weight: 900; }
.rule-help { color: var(--muted); font-size: 13px; }
.rule-box textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: Consolas, Monaco, monospace;
  font-size: 14px;
  line-height: 1.45;
  background: #fff;
}
.rules-tips {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f4f7fc;
  color: #40506b;
  font-size: 14px;
}
.recent-table-wrap table { min-width: 900px; }
.compact-card { padding: 18px; }
.rules-used-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.rules-used-grid h3 { margin: 0 0 8px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  padding: 7px 10px;
  background: #f1f5fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}
.issues-card { padding: 20px; }
.issues-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
}
.issues-title-row h2 { margin: 0; }
.issue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.issue-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 170px;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 8px solid #d8deea;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(19, 36, 71, 0.05);
}
.issue-card.error { border-left-color: var(--error); }
.issue-card.warning { border-left-color: #f6bf3f; }
.issue-card.info { border-left-color: var(--info); }
.issue-left, .issue-middle, .issue-right { min-width: 0; }
.issue-left { display: flex; flex-direction: column; gap: 8px; }
.file-title {
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.meta-grid div {
  background: #f8fafd;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 0;
}
.meta-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 3px;
}
.meta-grid strong { display: block; overflow-wrap: anywhere; }
.issue-detail h3 { margin: 0 0 4px; font-size: 16px; }
.issue-detail p { margin: 6px 0; line-height: 1.35; }
.action-text { color: #26344d; }
.issue-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.evidence-btn { width: 100%; white-space: nowrap; }
.sticky-actions {
  position: sticky;
  top: 68px;
  z-index: 3;
  background: rgba(247, 249, 252, .86);
  backdrop-filter: blur(8px);
  padding: 8px 0;
}

@media (max-width: 1180px) {
  .issue-card { grid-template-columns: 230px minmax(0, 1fr) 150px; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .rules-grid, .rules-used-grid { grid-template-columns: 1fr; }
  .rules-header { flex-direction: column; }
  .issue-card { grid-template-columns: 1fr; }
  .issue-right { justify-content: flex-start; }
  .evidence-btn { width: auto; }
}

/* Stage 1.3 ABA AUDIT / Rules Manager */
.topbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topnav { display: inline-flex; gap: 8px; margin-left: 8px; }
.topnav a {
  color: #33415c;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f3f6fb;
  border: 1px solid var(--line);
}
.topnav a:hover { background: #eaf1ff; color: var(--primary-dark); }
.rules-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  background: #f8fafd;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.rules-status h2 { margin: 0 0 4px; }
.rules-status p { margin: 0; color: var(--muted); }
.details-summary {
  cursor: pointer;
  font-weight: 900;
  font-size: 18px;
  list-style-position: inside;
}
.rules-manager-card { max-width: 1180px; }
.rules-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}
.rules-manager-header h2 { margin: 0 0 4px; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }
.quality-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.quality-card {
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 16px;
  padding: 16px;
}
.checkline {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 900;
  margin-bottom: 12px;
}
.checkline input { width: 18px; height: 18px; }
.field-label, .severity-select.full {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 900;
  margin-bottom: 12px;
}
.field-label input, .severity-select.full select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: white;
}
.save-banner {
  background: #eaf7ee;
  border: 1px solid #bfe6ca;
  color: #136b31;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 900;
  margin: 10px 0 16px;
}
@media (max-width: 1050px) {
  .quality-grid { grid-template-columns: 1fr; }
  .rules-status, .rules-manager-header { flex-direction: column; align-items: stretch; }
}

/* Stage 1.3 CRM dashboard and workflow */
.crm-hero, .results-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.crm-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.complete-text { color: #128246; }
.badge.open { background: #fff3d6; color: #8a5600; }
.badge.complete { background: #eaf7ee; color: #136b31; }
.badge.status-badge { background: #eef3fb; color: #344966; }
.section-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.crm-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.person-list { display: flex; flex-direction: column; gap: 12px; }
.person-card.mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 16px;
  padding: 14px;
}
.person-counts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tabbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tab-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f6fb;
  padding: 9px 13px;
  font-weight: 900;
  cursor: pointer;
  color: #33415c;
}
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.person-group-list { display: flex; flex-direction: column; gap: 18px; }
.person-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff, #ffffff);
  padding: 16px;
}
.person-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.person-header h3 { margin: 0 0 4px; font-size: 22px; }
.status-form {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 80px;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafd;
}
.status-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 900; color: #44506a; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.status-form select, .status-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: white;
  color: var(--text);
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.stacked-actions { flex-direction: column; align-items: stretch; gap: 8px; justify-content: center; }
.small-muted { font-size: 11px; text-align: center; }
.issue-card.status-complete { opacity: .78; border-left-color: #31b66b; }
.issue-card.status-ignore---not-applicable { opacity: .72; border-left-color: #9aa7b8; }
@media (max-width: 1200px) {
  .crm-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-grid-2 { grid-template-columns: 1fr; }
  .status-form { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .crm-hero, .results-hero, .person-header, .person-card.mini { flex-direction: column; align-items: stretch; }
  .crm-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-actions { justify-content: flex-start; }
}

/* Stage 1.4 login, clickable CRM, and user management */
.topbar-right { display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark, .login-mark {
  display: inline-grid; place-items: center; font-weight: 900;
  background: linear-gradient(135deg, #1463ff, #12b981); color: white;
  border-radius: 14px;
}
.brand-mark { width: 34px; height: 34px; font-size: 13px; }
.login-container { max-width: 100%; padding: 0; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 0%, #dce8ff 0, transparent 38rem), linear-gradient(135deg, #f7f9fc, #edf5ff);
}
.login-card {
  width: min(460px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 26px 80px rgba(19,36,71,.16);
  padding: 34px;
}
.login-logo { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.login-mark { width: 72px; height: 72px; font-size: 24px; box-shadow: var(--shadow); }
.login-logo h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.login-logo p { margin: 4px 0 0; color: var(--muted); }
.login-form { display: grid; gap: 14px; }
.login-form label, .admin-user-form label { display: flex; flex-direction: column; gap: 7px; font-weight: 800; }
.login-form input, .admin-user-form input {
  min-height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 16px;
}
.login-error, .flash.error { background: var(--error-bg); color: var(--error); padding: 12px 14px; border-radius: 14px; font-weight: 800; margin-bottom: 14px; }
.flash.success { background: #eaf7ee; color: #116932; padding: 12px 14px; border-radius: 14px; font-weight: 800; margin: 14px 0; }
.full { width: 100%; }
.center { text-align: center; }
.admin-user-form { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 14px; align-items: end; }
.check-row { flex-direction: row !important; align-items: center; padding-bottom: 12px; }
.no-shadow { box-shadow: none; }
.link-clean, .person-card-link, .summary-card.click-card { text-decoration: none; color: inherit; }
.click-card { transition: transform .12s ease, border-color .12s ease; }
.click-card:hover, .person-card-link:hover .person-card, .file-card:hover, .clickable-panel:hover {
  transform: translateY(-1px);
  border-color: #b8c7e8;
  box-shadow: 0 18px 42px rgba(19,36,71,.12);
}
.clickable { cursor: pointer; text-decoration: none; }
.clickable:hover { filter: brightness(.95); }
.clickable-panel { display: block; cursor: pointer; border-radius: 14px; padding: 6px; margin: -6px; }
.person-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.person-card-link { display: block; }
.person-card {
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 18px;
  padding: 18px;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.person-name-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.person-name-row h3 { margin: 0; font-size: 22px; }
.clickable-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.file-card { display: block; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.status-form select, .status-form input {
  min-height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: white;
}
@media (max-width: 900px) {
  .admin-user-form { grid-template-columns: 1fr; }
  .topbar-right { width: 100%; justify-content: space-between; }
}

/* Stage 1.5 admin control, clickable dashboard, reset jobs */
.btn.danger { background: #fff; color: var(--error); border-color: #f0b9b9; }
.btn.danger:hover { background: var(--error-bg); }
button.btn.danger.big-btn { min-height: 50px; }
.click-row { cursor: pointer; }
.click-row:hover td { background: #f8fbff; }
.admin-users-table table { min-width: 1250px; }
.admin-actions { display: grid; gap: 8px; min-width: 250px; }
.inline-password-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-password-form input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 140px;
}
.admin-control-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.big-inline-form input { min-height: 42px; min-width: 240px; }
.activity-list { display: grid; gap: 12px; }
.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 16px;
  padding: 14px;
}
.activity-details { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.activity-details span {
  background: #f0f4fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
}
.small-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .activity-item, .admin-control-row, .inline-password-form { flex-direction: column; align-items: stretch; }
  .small-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.rule-explain-box {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--primary);
  background: #f8fbff;
  border-radius: 16px;
}
.rule-explain-box h2 { margin-bottom: 8px; }
.rule-explain-box p { margin: 6px 0; }

/* Stage 1.8 Professional Rules Manager */
.rules-hero-v2 {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}
.rules-v2-form { max-width: 1180px; }
.pro-rule-section {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-radius: 22px;
  overflow: hidden;
}
.rule-section h2 {
  margin: 0 0 8px;
  font-size: 24px;
}
.rule-section h2 span, .rule-section h3 span, .rule-section em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}
.rule-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.rule-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}
.split-head { align-items: center; }
.toggle-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #f8fafd;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  white-space: nowrap;
}
.toggle-card input { width: 18px; height: 18px; }
.toggle-card span { color: var(--muted); }
.add-rule-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) 200px minmax(260px, 1fr) 80px;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7faff;
  margin: 14px 0 16px;
}
.add-rule-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 900;
  color: #26344d;
}
.add-rule-grid label span {
  font-size: 13px;
}
.add-rule-grid input, .add-rule-grid select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  background: white;
  font: inherit;
}
.rule-table-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.rule-table {
  width: 100%;
  border-collapse: collapse;
}
.rule-table th {
  text-align: left;
  background: #f4f7fc;
  color: #53627a;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 12px;
  padding: 12px 14px;
}
.rule-table td {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  vertical-align: middle;
}
.rule-table td:first-child { width: 24%; overflow-wrap: anywhere; }
.rule-table td:nth-child(2) { width: 120px; }
.rule-table td:last-child { width: 95px; text-align: right; }
.badge.error { background: #ffe8e8; color: #9b1c1c; }
.badge.warning { background: #fff3d6; color: #8a5600; }
.badge.info { background: #eaf1ff; color: #183f76; }

/* Stage 4.5 Rules Manager edit/update polish */
.add-rule-grid-clear {
  grid-template-columns: minmax(280px, 1.4fr) 190px minmax(260px, 1fr);
}
.add-rule-grid-clear .rule-note-field {
  grid-column: 1 / -1;
}
.add-rule-grid-clear .rule-note-field textarea,
.rule-edit-note {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  background: white;
  font: inherit;
  resize: vertical;
}
.add-rule-grid-clear .add-rule-button {
  grid-column: 1 / 2;
}
.rule-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.rule-table td:last-child {
  width: 155px;
}
.editing-rule-row td {
  background: #fffdf5;
}
.rule-edit-input,
.rule-edit-select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: white;
  font: inherit;
}
.rule-edit-note {
  width: 100%;
}
.rule-table td:nth-child(4) {
  min-width: 280px;
}
@media (max-width: 900px) {
  .add-rule-grid-clear {
    grid-template-columns: 1fr;
  }
  .add-rule-grid-clear .rule-note-field,
  .add-rule-grid-clear .add-rule-button {
    grid-column: 1;
  }
}

.quality-grid-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-section {
  background: linear-gradient(180deg, #fdfefe, #f7faff);
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.guide-grid > div {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: white;
}
.guide-grid h3 { margin: 0 0 10px; }
.guide-grid ul { margin: 0; padding-left: 18px; color: #26344d; line-height: 1.55; }
.sticky-rule-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0 4px;
  background: rgba(247,249,252,.88);
  backdrop-filter: blur(10px);
}
@media (max-width: 980px) {
  .rules-hero-v2, .rule-section-head, .split-head { flex-direction: column; align-items: stretch; }
  .add-rule-grid { grid-template-columns: 1fr; }
  .quality-grid-v2, .guide-grid { grid-template-columns: 1fr; }
}

/* Stage 1.9 Communication Center */
.form-grid.two { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 14px; align-items: end; }
.form-grid label, .send-form label { display: grid; gap: 7px; font-weight: 800; color: var(--ink); }
.form-grid input, .inline-form input, .inline-form select, .send-form input, .send-form select, .send-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; background: #fff; color: var(--ink); }
.inline-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline-form input { max-width: 420px; }
.check-row { margin: 14px 0; display: flex; gap: 12px; align-items: center; color: var(--muted); }
.stacked-checks { flex-direction: column; align-items: flex-start; justify-content: center; }
.form-actions, .send-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.message-box { min-height: 360px; font-family: Consolas, Monaco, monospace; line-height: 1.35; white-space: pre-wrap; }
.btn.whatsapp { background: #12b76a; color: white; border-color: #12b76a; }
.btn.whatsapp:hover { filter: brightness(.96); }
.communication-card select { min-width: 230px; }
.help-card p { color: var(--muted); }
@media (max-width: 900px) { .form-grid.two { grid-template-columns: 1fr; } }

/* Stage 2.0 - grouped communication status */
.crm-summary { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.badge.sent { background: #e7f0ff; color: #1e4fb7; }
.sent-text { color: #1e4fb7; }
.status-sent-to-rbt, .status-sent-to-bcba { border-left-color: #2563eb; }
.status-sent-to-rbt .status-badge, .status-sent-to-bcba .status-badge { background: #e7f0ff; color: #1e4fb7; }

/* Stage 2.1 - AI Narrative Review side panel */
.viewer-ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}
.pdf-viewer-panel { overflow: auto; }
.ai-side-panel {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}
.ai-panel-head h2 { margin: 0 0 6px; }
.ai-panel-head p { margin: 0 0 16px; color: var(--muted); }
.ai-run-form { margin: 12px 0 16px; }
.ai-score-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff, #eef6ff);
  margin-bottom: 14px;
}
.ai-score-card .label { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
.ai-score-card strong { font-size: 34px; color: #0b5cff; }
.ai-block { border-top: 1px solid var(--line); padding-top: 13px; margin-top: 13px; }
.ai-block h3 { margin: 0 0 8px; font-size: 15px; }
.ai-block p { color: #26344d; line-height: 1.45; white-space: pre-wrap; }
.ai-block.rewrite { background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.muted-block { color: var(--muted); }
.small-flash { padding: 10px 12px; margin-bottom: 12px; }
.settings-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}
.settings-check-grid label {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fbfdff;
  color: var(--ink);
  font-weight: 800;
}
.settings-check-grid small { display: block; margin-top: 6px; color: var(--muted); font-weight: 500; line-height: 1.35; }
.ai-settings-card select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: white; color: var(--ink); font: inherit; }
@media (max-width: 1150px) {
  .viewer-ai-layout { grid-template-columns: 1fr; }
  .ai-side-panel { position: relative; top: auto; max-height: none; }
}

/* Stage 2.2 - AI diagnostics */
.api-status-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}
.ai-test-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 18px;
}
.permission-form{display:grid;gap:6px;min-width:140px}.mini-check{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:700}.btn.tiny{padding:6px 10px;font-size:12px;border-radius:10px}.small-text{font-size:12px}.wide-admin-table table{min-width:1180px}.send-actions button:disabled{opacity:.45;cursor:not-allowed;filter:grayscale(1)}

/* Stage 2.4 system/product foundation */
.backup-form { align-items: end; }
.kv-list { display: grid; gap: 10px; }
.kv-list div { display: grid; grid-template-columns: 180px 1fr; gap: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft); }
.kv-list strong { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kv-list span { overflow-wrap: anywhere; }
.help-grid h3 { margin-bottom: 6px; }
@media (max-width: 760px) { .kv-list div { grid-template-columns: 1fr; } }


/* Stage 2.7 dashboard polish */
.info-text { color: var(--info); }
.slim-card {
  padding: 12px 16px;
  margin: 8px 0 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: none;
}
.dashboard-summary-27 {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}
.status-legend .badge {
  vertical-align: middle;
  margin-right: 4px;
}

/* Stage 2.8 report/export polish */
.print-page { max-width: 1100px; margin: 0 auto 40px; }
.print-header { border-bottom: 2px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.print-summary { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); margin-bottom: 18px; }
.print-issue { border: 1px solid var(--line); border-left: 6px solid var(--primary); border-radius: 16px; padding: 16px 18px; margin: 14px 0; background: #fff; break-inside: avoid; }
.print-issue h2 { margin: 0 0 12px; font-size: 18px; }
.print-issue p { margin: 6px 0; line-height: 1.45; }
.ai-report-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 12px; background: #f8fafc; }
.ai-report-box h3 { margin: 0 0 8px; }
@media print {
  body { background: #fff !important; }
  .topbar, .no-print, .hero, .btn { display: none !important; }
  .card { box-shadow: none !important; border: none !important; }
  .print-page { max-width: 100%; margin: 0; padding: 0; }
  .print-issue { page-break-inside: avoid; }
}


.archive-text{color:#6b5b00}
.badge.archive{background:#eee7ff;color:#5b21b6}
.archive-filter-grid{display:grid;grid-template-columns:1.5fr .8fr 1fr 1fr 1fr 1fr auto auto;gap:.7rem;align-items:end}
.archive-filter-grid input,.archive-filter-grid select{width:100%}
.inline-form{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap}
@media (max-width: 1100px){.archive-filter-grid{grid-template-columns:1fr 1fr}}


/* Stage 3.0 - AI disclaimer / human-review guardrail */
.ai-disclaimer-box {
  border: 1px solid #f2c94c;
  background: #fffbeb;
  color: #4b3b00;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0;
}
.ai-disclaimer-box h3 { margin: 0 0 6px; font-size: 15px; color: #7a4f01; }
.ai-disclaimer-box p { margin: 4px 0; font-size: 13px; line-height: 1.45; }
.ai-disclaimer-box.compact { margin-bottom: 14px; }
.ai-ack-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 12px;
  color: #1f2937;
  font-weight: 700;
  line-height: 1.35;
}
.ai-ack-row input { margin-top: 2px; }

/* Stage 3.2 - in-app support chat + admin support inbox */
.support-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 900;
  color: #fff;
  background: var(--primary, #2563eb);
  box-shadow: 0 16px 35px rgba(37, 99, 235, .35);
  cursor: pointer;
}
.support-panel {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: 1001;
  width: min(420px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 110px));
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
  display: none;
  overflow: hidden;
}
.support-panel.open { display: grid; grid-template-rows: auto 1fr auto; }
.support-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  background: #f8fafc;
}
.support-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted, #64748b); }
.icon-btn { border: none; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: #334155; }
.support-messages { padding: 14px; overflow: auto; max-height: 410px; display: grid; gap: 10px; }
.support-msg { padding: 11px 13px; border-radius: 15px; font-size: 13px; line-height: 1.42; white-space: pre-wrap; }
.support-msg.bot { background: #f1f5f9; color: #0f172a; border: 1px solid #e2e8f0; }
.support-msg.user { background: #dbeafe; color: #0b2c60; justify-self: end; max-width: 88%; }
.support-form { padding: 12px 14px 14px; border-top: 1px solid var(--line, #e5e7eb); background: #fff; }
.support-form textarea { width: 100%; min-height: 58px; resize: vertical; }
.support-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; }
.support-actions select { max-width: 145px; }
.support-request-list { display: grid; gap: 14px; }
.support-request-card { border: 1px solid var(--line, #e5e7eb); border-radius: 18px; padding: 16px; background: #fff; }
.support-request-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line, #e5e7eb); }
.support-question, .support-answer { margin: 12px 0; padding: 12px; border-radius: 14px; background: #f8fafc; border: 1px solid #e2e8f0; }
.support-question p, .support-answer p { margin: 6px 0 0; line-height: 1.45; }
.support-update-form { display: grid; grid-template-columns: 150px 140px 1fr auto; gap: 10px; align-items: end; }
.support-update-form label { font-weight: 800; color: var(--muted, #64748b); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.support-update-form label input, .support-update-form label select { margin-top: 6px; width: 100%; }
@media (max-width: 760px){ .support-update-form{grid-template-columns:1fr} .support-panel{right:14px;bottom:78px} }

/* Stage 4.5 Help Center / Knowledge Base */
.help-hero, .help-article-hero { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; }
.help-search-card h2 { margin-top: 0; }
.help-search-form { display: grid; grid-template-columns: minmax(260px, 1fr) 240px auto; gap: 12px; align-items: center; }
.help-search-form input, .help-search-form select, .support-request-form textarea, .support-request-form select, .mini-support-form textarea, .mini-support-form select {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: white; font: inherit;
}
.help-quick-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.help-chip { text-decoration: none; background: #f3f6fc; border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px; font-weight: 800; font-size: 13px; }
.help-chip:hover, .article-card:hover { border-color: var(--primary); box-shadow: 0 10px 24px rgba(20, 99, 255, .10); }
.article-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.featured-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.article-card { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fbfdff; transition: .15s ease; color: var(--text); }
.article-card.featured { background: linear-gradient(180deg, #ffffff, #f6f9ff); }
.article-card h3, .article-card h4 { margin: 8px 0; }
.article-card p { color: var(--muted); margin: 0 0 12px; line-height: 1.45; }
.article-category { display: inline-flex; border-radius: 999px; background: var(--info-bg); color: var(--info); padding: 5px 9px; font-weight: 900; font-size: 12px; }
.article-visual-mini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.article-visual-mini span { background: white; border: 1px dashed #b8c5db; border-radius: 999px; color: #44506a; padding: 4px 8px; font-size: 11px; font-weight: 800; }
.help-category-block { margin: 20px 0 28px; }
.section-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.help-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.help-sidebar { position: sticky; top: 92px; }
.help-category-nav { display: grid; gap: 8px; }
.help-category-nav a { text-decoration: none; border: 1px solid var(--line); background: #f8fafd; border-radius: 12px; padding: 10px 12px; font-weight: 800; }
.help-article-card { padding: 26px; }
.help-article-card h2 { margin-top: 26px; }
.visual-guide { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, #f8fbff, #ffffff); }
.visual-step { display: flex; align-items: center; gap: 12px; }
.visual-screen { width: 150px; min-height: 96px; border: 1px solid #cad5e8; background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 18px rgba(19, 36, 71, 0.07); }
.visual-top { height: 18px; background: #e9eef8; border-bottom: 1px solid #cad5e8; }
.visual-body { display: grid; gap: 8px; place-items: center; text-align: center; padding: 12px 8px; font-size: 13px; }
.visual-box { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--primary); color: white; font-weight: 900; }
.visual-arrow { font-size: 24px; color: var(--primary); font-weight: 900; }
.help-steps { counter-reset: item; padding-left: 22px; line-height: 1.65; }
.help-steps li { margin: 9px 0; padding-left: 4px; }
.tip-list { display: grid; gap: 10px; }
.tip-card { border-left: 5px solid var(--warning); background: var(--warning-bg); border-radius: 12px; padding: 12px 14px; color: #5d3a00; }
.next-action-box { margin-top: 26px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #f6f9ff; }
.support-request-form { display: grid; grid-template-columns: minmax(240px, 1fr) 160px auto; gap: 10px; margin-top: 16px; align-items: end; }
.support-request-form h3, .support-request-form p { grid-column: 1 / -1; margin: 0; }
.mini-support-form { display: grid; gap: 10px; }
.support-help-link { padding: 10px 12px 0; }
.full { width: 100%; }
@media (max-width: 900px) {
  .help-search-form, .support-request-form { grid-template-columns: 1fr; }
  .help-layout { grid-template-columns: 1fr; }
  .help-sidebar { position: static; }
  .help-hero, .help-article-hero { flex-direction: column; }
}

/* Stage 4.5 communication report preview polish */
.correction-report-preview {
  border: 1px solid #d8e2ef;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 10px 28px rgba(19, 36, 71, 0.07);
  padding: 16px;
  margin-top: 8px;
}
.preview-label {
  display: block;
  color: #5f6f87;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
  margin-bottom: 4px;
}
.preview-subject-card {
  background: #eef5ff;
  border: 1px solid #c7dbff;
  border-left: 6px solid #1463ff;
  color: #0f2f66;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.preview-panel-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
.preview-panel-title h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.02em;
}
.preview-count-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  white-space: nowrap;
}
.preview-intro-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 12px;
}
.preview-intro-card p { margin: 0 0 8px; }
.preview-intro-card p:last-child { margin-bottom: 0; }
.preview-ai-note {
  background: #fff8db;
  border: 1px solid #f7d96c;
  border-left: 6px solid #eab308;
  color: #5b4300;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.preview-summary-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.preview-summary-card > div {
  background: #f1f5f9;
  border: 1px solid #d9e2ee;
  border-radius: 14px;
  padding: 12px 14px;
}
.preview-summary-card span,
.preview-meta-grid span,
.preview-block span {
  display: block;
  color: #53657c;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.preview-summary-card strong { font-size: 16px; color: #172033; }
.preview-issue-list { display: grid; gap: 14px; }
.preview-issue-card {
  background: #ffffff;
  border: 1px solid #e1e8f2;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(19, 36, 71, 0.06);
  padding: 14px;
  overflow: hidden;
}
.preview-issue-card.severity-error { border-left: 7px solid #dc2626; }
.preview-issue-card.severity-warning { border-left: 7px solid #f59e0b; }
.preview-issue-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
  margin-bottom: 12px;
}
.preview-issue-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #102a56;
  color: white;
  font-weight: 900;
}
.preview-issue-card.severity-warning .preview-issue-number { background: #d97706; }
.preview-issue-card.severity-error .preview-issue-number { background: #dc2626; }
.preview-issue-header h4 {
  margin: 6px 0 0;
  font-size: 19px;
  letter-spacing: -.01em;
}
.preview-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.preview-meta-grid > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}
.preview-meta-grid > div:first-child { grid-column: 1 / -1; }
.preview-meta-grid strong { color: #172033; font-weight: 800; }
.preview-block {
  border-radius: 14px;
  padding: 11px 13px;
  margin-top: 10px;
  border: 1px solid transparent;
}
.preview-block p { margin: 0; line-height: 1.45; }
.preview-block.problem {
  background: #fff1f2;
  border-color: #fecdd3;
  border-left: 6px solid #e11d48;
}
.preview-block.problem span { color: #be123c; }
.preview-block.evidence {
  background: #f8fafc;
  border-color: #dbe5f0;
  border-left: 6px solid #64748b;
}
.preview-block.action {
  background: #ecfdf5;
  border-color: #bbf7d0;
  border-left: 6px solid #10b981;
}
.preview-block.action span { color: #047857; }
.preview-block.ai {
  background: #eef2ff;
  border-color: #c7d2fe;
  border-left: 6px solid #6366f1;
}
.preview-block.ai span { color: #4338ca; }
.preview-footer-note {
  margin-top: 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 11px 13px;
  color: #475569;
  font-weight: 700;
}
.plain-text-details {
  margin-top: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}
.plain-text-details summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 900;
  color: #0f3a67;
  background: #f8fbff;
}
.plain-text-details .message-box {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  min-height: 240px;
}
.plain-text-details p { padding: 0 14px 12px; margin: 0; }
@media (max-width: 780px) {
  .preview-panel-title { align-items: flex-start; flex-direction: column; }
  .preview-summary-card, .preview-meta-grid { grid-template-columns: 1fr; }
  .preview-meta-grid > div:first-child { grid-column: auto; }
}

/* Stage 4.5 - Communication History page */
.communication-summary-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.history-filter-form input[type="text"] { min-width: min(420px, 100%); }
.communication-history-table table { min-width: 1180px; }
.communication-history-table td { vertical-align: top; }
.actions-cell { white-space: nowrap; display: flex; gap: 8px; flex-wrap: wrap; }
.communication-detail-card { background: linear-gradient(180deg, #ffffff, #f8fbff); }
.history-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.saved-report-body {
  background: #0f172a;
  color: #e5edf8;
  border-radius: 16px;
  padding: 18px;
  white-space: pre-wrap;
  overflow: auto;
  border: 1px solid #1e293b;
  line-height: 1.45;
  font-family: Consolas, Monaco, monospace;
  font-size: 14px;
}
.issue-id-list { display: flex; gap: 8px; flex-wrap: wrap; }
.issue-id-list code { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .history-detail-grid { grid-template-columns: 1fr; }
}

/* Stage 4.5 Address Book */
.address-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.address-book-form { display: flex; flex-direction: column; gap: 14px; }
.address-book-top-row { align-items: end; }
.address-book-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; color: #25304a; }
.address-book-form label span { color: #44506a; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.address-book-form input,
.address-book-form select,
.address-book-form textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; background: #fbfdff; font: inherit;
}
.address-book-form textarea { min-height: 86px; resize: vertical; }
.address-contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.address-contact-card {
  border: 1px solid #dbe5f4; border-radius: 18px; background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 10px 28px rgba(19, 36, 71, 0.08); padding: 18px;
}
.address-contact-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.address-contact-head h3 { margin: 0 0 8px; font-size: 20px; }
.address-contact-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.address-contact-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.address-contact-info > div {
  border: 1px solid var(--line); border-radius: 14px; background: #f8fbff; padding: 11px;
  display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere;
}
.address-contact-info span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 900; }
.address-contact-info strong { color: #16223a; }
.address-contact-notes { margin-top: 12px; border-left: 5px solid #9fc2ff; background: #edf5ff; padding: 10px 12px; border-radius: 12px; }
.address-edit-details { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.address-edit-details summary { cursor: pointer; font-weight: 900; color: var(--primary-dark); }
.compact-edit-form { margin-top: 12px; }
.address-edit-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.address-delete-form { margin-top: 8px; }
.btn.danger { color: #b42318; border-color: #ffb4ab; background: #fff7f6; }
.btn.danger:hover { background: #ffe7e4; }
@media (max-width: 900px) {
  .address-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .address-contact-grid { grid-template-columns: 1fr; }
  .address-contact-head { flex-direction: column; }
  .address-contact-info { grid-template-columns: 1fr; }
}
.form-grid.four { display: grid; grid-template-columns: 1.4fr .9fr 1.2fr 1.1fr; gap: 14px; }
@media (max-width: 1100px) { .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .form-grid.four { grid-template-columns: 1fr; } }

/* Stage 4.6 CRM sidebar layout + restore backup polish */
body {
  background: linear-gradient(135deg, #f5f8ff 0%, #edf3fb 44%, #f8fbff 100%);
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-right: 1px solid #dfe7f2;
  box-shadow: 10px 0 35px rgba(17, 42, 86, 0.06);
  padding: 18px 14px;
  z-index: 12;
}
.sidebar-brand-row {
  display: grid;
  gap: 8px;
  padding: 6px 8px 16px;
  border-bottom: 1px solid #e6edf7;
  margin-bottom: 14px;
}
.sidebar-brand { font-size: 19px; color: #0f203d; }
.sidebar-stage {
  margin-left: 45px;
  font-size: 12px;
  background: #eef5ff;
  color: #34537a;
  border: 1px solid #d6e5fb;
  border-radius: 999px;
  padding: 5px 10px;
  width: fit-content;
}
.side-nav { display: grid; gap: 16px; }
.side-section { display: grid; gap: 6px; }
.side-label {
  padding: 8px 10px 4px;
  color: #75849a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  text-decoration: none;
  border-radius: 13px;
  color: #27364f;
  font-size: 14px;
  font-weight: 850;
  border: 1px solid transparent;
  transition: background .12s ease, color .12s ease, transform .12s ease, border-color .12s ease;
}
.side-link span { width: 24px; text-align: center; }
.side-link:hover {
  transform: translateX(2px);
  background: #eef5ff;
  border-color: #d6e5fb;
  color: #0e54d4;
}
.side-link.active {
  background: linear-gradient(135deg, #1463ff, #0e52d4);
  color: #fff;
  box-shadow: 0 10px 22px rgba(20, 99, 255, .22);
}
.main-panel { min-width: 0; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  background: rgba(255,255,255,.82);
  border-bottom: 1px solid #dfe7f2;
  backdrop-filter: blur(16px);
}
.app-header strong { font-size: 20px; color: #102033; }
.crumb { color: #74839b; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.app-container { max-width: 1520px; padding: 28px 34px 48px; }
.hero h1 { font-size: clamp(32px, 3vw, 48px); }
.card, .summary-card, .file-card, .table-wrap {
  border-color: #dfe7f2;
  box-shadow: 0 18px 55px rgba(17, 42, 86, .08);
}
.btn { border-radius: 12px; }
.btn.danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn.danger:hover { background: #b91c1c; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 16px 0 22px;
}
.stat-card {
  background: rgba(255,255,255,.92);
  border: 1px solid #dfe7f2;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 12px 30px rgba(17, 42, 86, .07);
}
.stat-card strong { display: block; font-size: 28px; line-height: 1; margin-bottom: 7px; color: #0f3a67; }
.stat-card span { color: #68738a; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.system-backup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.system-card { overflow: hidden; }
.card-icon-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.card-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf1ff;
  color: #145bdc;
  font-size: 23px;
  flex: 0 0 auto;
}
.card-icon.danger { background: #fff1f2; color: #dc2626; }
.card-icon-title h2 { margin: 0 0 6px; }
.polished-form label, .file-input-card, .restore-option, .restore-confirm-check {
  background: #f8fbff;
  border: 1px solid #dfe7f2;
  border-radius: 15px;
  padding: 14px;
}
.restore-upload-form { display: grid; gap: 14px; }
.file-input-card { display: grid; gap: 8px; cursor: pointer; }
.file-input-card input { width: 100%; }
.file-input-card small { color: #68738a; }
.restore-warning {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #8a4b08;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.4;
}
.system-inline-form {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.system-inline-form label { min-width: 210px; }
.system-inline-form input { max-width: 120px; display: inline-block; margin: 0 6px; }
.restore-preview-card {
  border: 2px solid #fdba74;
  background: linear-gradient(180deg, #fffaf5, #ffffff 38%);
}
.restore-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.restore-preview-grid div {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
}
.restore-preview-grid span { display: block; color: #68738a; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.restore-preview-grid strong { overflow-wrap: anywhere; }
.restore-contents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.restore-chip {
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 900;
  font-size: 13px;
  border: 1px solid #dfe7f2;
  background: #f8fbff;
}
.restore-chip.ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.restore-chip.warn { background: #fff7ed; color: #9a5b00; border-color: #fed7aa; }
.restore-chip.bad { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.restore-confirm-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid #fde7c8;
  padding-top: 16px;
  margin-top: 12px;
}
.restore-option, .restore-confirm-check { display: flex; align-items: center; gap: 10px; font-weight: 850; width: 100%; }
.restore-confirm-check { background: #fff1f2; border-color: #fecaca; color: #991b1b; }
.system-paths-card .kv-list div { background: #f8fbff; border-color: #dfe7f2; }
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #dfe7f2;
  }
  .side-nav { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .app-header { position: sticky; top: 0; }
  .system-backup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app-header { flex-direction: column; align-items: stretch; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .app-container { padding: 18px; }
  .side-nav { grid-template-columns: 1fr; }
  .system-inline-form { align-items: stretch; }
  .system-inline-form label, .system-inline-form .btn { width: 100%; }
}

/* Stage 4.8 Rules Manager scope filtering + Service Log policy cards */
.scope-filter-row td {
  background: #f8fbff;
  color: #48607f;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px dashed #d7e2f0;
}
.two-col-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.service-log-rule-card {
  border-left: 4px solid #2563eb;
}
@media (max-width: 760px) {
  .two-col-inline { grid-template-columns: 1fr; }
}


/* Stage 4.8 dashboard document-type visibility */
.doc-card .big { color: #0f3a67; }
.calendar-card { border-left: 5px solid #1d4ed8; }
.service-log-card { border-left: 5px solid #059669; }
.appointment-card { border-left: 5px solid #7c3aed; }
.doc-type-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.badge.doc-type {
  border: 1px solid rgba(15, 58, 103, 0.10);
  background: #eef4ff;
  color: #244266;
  white-space: nowrap;
}
.badge.doc-type.calendar { background: #eaf2ff; color: #1e40af; }
.badge.doc-type.service-log { background: #e7f7ef; color: #047857; }
.badge.doc-type.appointment-note { background: #f0eaff; color: #6d28d9; }
.badge.doc-type.other { background: #f3f4f6; color: #4b5563; }
.mini-doc-types { margin-top: 6px; }
.mini-doc-types .badge { font-size: 11px; padding: 4px 7px; }
.recent-table-wrap table { min-width: 1040px; }
/* Stage 5.5 Doctor Note builder */
.success-box{background:#ecfdf5;border:1px solid #bbf7d0;color:#14532d;border-radius:14px;padding:12px 14px;margin:12px 0;font-weight:700}
.warning-box{background:#fff7ed;border:1px solid #fed7aa;color:#7c2d12;border-radius:14px;padding:12px 14px;margin:12px 0;font-weight:700}
.details-box{border:1px dashed #cbd5e1;border-radius:14px;padding:12px;margin:10px 0;background:#f8fafc}.details-box summary{cursor:pointer;font-weight:800;color:#1e3a8a}.center{text-align:center}
.grid.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.stacked-form{display:grid;gap:12px;margin-top:12px}.stacked-form label{display:grid;gap:6px;font-weight:800}.stacked-form input[type=file]{border:1px solid #d7e1ef;border-radius:12px;padding:10px;background:#fff}@media(max-width:900px){.grid.two{grid-template-columns:1fr}}

/* Stage 5.8 Safe Update Installer */
.update-card {
  border-left: 5px solid #2563eb;
}
.update-safety-box {
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  color: #0f3a67;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0;
  line-height: 1.45;
}
.update-safety-box code {
  background: #ffffff;
  border: 1px solid #dbeafe;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 800;
}
.update-preview-card {
  border-left: 5px solid #2563eb;
}
.mini-list-card {
  border: 1px solid #dbe3ef;
  background: #f8fbff;
  border-radius: 14px;
  padding: 14px;
}
.compact-list {
  margin: 8px 0 0 0;
  padding-left: 18px;
  max-height: 260px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.45;
}
/* Stage 5.9 Corrected Documents */
.alert{border-radius:14px;padding:14px 16px;margin:14px 0;font-weight:800;border:1px solid #dbe7fb;background:#eef6ff;color:#123b73}.alert.error{background:#ffe8e8;border-color:#ffc6c6;color:#9b1c1c}.alert.success{background:#eaf7ee;border-color:#bde8ca;color:#136b31}.success-text{color:#136b31}.compact-fields{align-items:end}.actions-end{display:flex;align-items:end;justify-content:flex-end}.mini-card{background:#fff;border:1px solid #dbe4f0;border-radius:14px;padding:12px;margin:8px 0;box-shadow:0 6px 18px rgba(15,35,75,.04)}


/* Stage 6.1 Evidence Packet */
.person-card-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.person-list > .person-card-actions { margin: -8px 0 12px 10px; }
.packet-note { margin-top: 10px; }
.packet-attach-note { margin: 14px 0; padding: 12px; border: 1px solid #dbeafe; border-radius: 14px; background: #eff6ff; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }


/* Stage 6.2 safety/security/update guard */
.security-guard-card {
  border: 1px solid rgba(32, 119, 91, 0.18);
}
.security-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  align-items: end;
}
.security-settings-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}
.security-settings-grid input[type="number"] {
  width: 100%;
}
.security-settings-actions {
  display: grid;
  gap: 8px;
  align-content: end;
}
.update-manifest-box {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(76, 108, 255, 0.18);
  border-radius: 16px;
  background: rgba(76, 108, 255, 0.06);
}
.rollback-card {
  border: 1px solid rgba(210, 80, 80, 0.18);
}
.restore-preview-grid.compact {
  margin: 12px 0;
}

/* Stage 6.2.3 — Super Admin company selector */
.company-scope-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.company-scope-form select {
  min-width: 250px;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 760px) {
  .company-scope-form,
  .company-scope-form select {
    width: 100%;
  }
}

/* Stage 6.2.4 — Reset jobs by document type */
.reset-section-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.reset-section-form select {
  min-width: 190px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: #7f1d1d;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.08);
}
@media (max-width: 760px) {
  .reset-section-form,
  .reset-section-form select,
  .reset-section-form button {
    width: 100%;
  }
}


/* Stage 6.2.5 Batch / Audit Name */
.batch-name-panel {
  border: 1px solid #dbe7ff;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  border-radius: 18px;
  padding: 18px;
  margin: 18px 0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}
.field-label { display: block; margin-bottom: 10px; }
.required-star { color: #dc2626; }
.text-input.big-input {
  width: 100%;
  max-width: 760px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  background: #fff;
}
.text-input.big-input:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
}
.confirm-line {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  color: #334155;
}
.audit-name-display {
  display: inline-block;
  max-width: 260px;
  font-size: 14px;
  line-height: 1.25;
  color: #0f172a;
}
.small-code {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}

/* Stage 6.3.1.3: standard admin log pages */
.retention-filter-form,
.disclaimer-filter-form { grid-template-columns: minmax(260px, 1.4fr) minmax(180px, .8fr) minmax(160px, .7fr) auto; align-items:end; }
.form-actions.align-end { display:flex; align-items:end; gap:10px; flex-wrap:wrap; }
.retention-table-wrap table,
.disclaimer-table-wrap table { min-width: 1180px; }
.file-list-cell { max-width: 330px; word-break: break-word; }
.file-list-cell div { margin-bottom: 3px; }
.device-cell { max-width: 360px; word-break: break-word; font-size: 12px; color: var(--muted); }
.log-table .badge { white-space: nowrap; }
@media(max-width: 900px){
  .retention-filter-form,
  .disclaimer-filter-form { grid-template-columns: 1fr; }
}

/* Stage 6.4.7: no-searchable-text / manual-review polish */
.upload-safety-note {
  margin: -4px 0 18px;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid #dbe7f7;
  background: #f7fbff;
  color: #43536a;
  font-size: 14px;
  line-height: 1.45;
}
.manual-review-banner {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #704200;
}
.manual-review-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid #dbe7f7;
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 16px 0;
}
.manual-review-card h2 { margin: 0 0 8px; }
.manual-review-card p { margin: 0 0 10px; color: var(--muted); }
.manual-review-card ul { margin: 8px 0 0 18px; color: #24324a; }
.manual-review-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fef3c7;
  color: #a16207;
  font-size: 24px;
  font-weight: 900;
}

/* Stage 6.4.8 — Issue CRM filter + no-reload save polish */
.active-filter-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.quick-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}
.chip-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faff;
  color: #233047;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 900;
}
.chip-btn:hover {
  background: #eaf1ff;
  border-color: #c7d9ff;
  color: var(--primary-dark);
}
.status-form .save-state {
  align-self: center;
  font-size: 12px;
  font-weight: 900;
  color: #66728a;
  min-height: 18px;
}
.status-form .save-state.saved {
  color: #128246;
}
.save-status-btn:disabled {
  opacity: .65;
  cursor: wait;
}
.quick-filter-summary .summary-card {
  cursor: pointer;
}
.quick-filter-summary .summary-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(19, 36, 71, 0.10);
}

/* Stage 6.6.18 — 2028 Command Center UI polish */
body.ui-2028 .brand-2028 small{display:block;font-size:11px;letter-spacing:.04em;color:#8ea4ce;margin-top:2px;font-weight:700;}
body.ui-2028 .brand-mark{width:40px;height:40px;border-radius:14px;display:inline-grid;place-items:center;color:#fff;font-weight:950;letter-spacing:-.08em;}
body.ui-2028 .hero h1, body.ui-2028 h1, body.ui-2028 h2, body.ui-2028 h3{color:#f7fbff;}
body.ui-2028 .click-row:hover{background:rgba(83,115,255,.1);}
body.ui-2028 .dropzone{background:rgba(10,22,42,.68);border-color:rgba(132,166,255,.28);}
body.ui-2028 .dropzone:hover, body.ui-2028 .dropzone.is-dragover{background:rgba(33,231,255,.08);border-color:rgba(33,231,255,.45);}
body.ui-2028 .file-card,body.ui-2028 .rules-panel,body.ui-2028 .issue-banner,body.ui-2028 .person-card,body.ui-2028 .status-legend{background:rgba(10,22,42,.68);border-color:rgba(132,166,255,.2);}
body.ui-2028 .flash.success{background:rgba(16,185,129,.14);border-color:rgba(16,185,129,.3);color:#b6ffe2;}
.command-hero-2028{display:grid;grid-template-columns:minmax(0,1.95fr) minmax(320px,.95fr);gap:18px;margin-bottom:18px;}
.hero-main-2028,.copilot-panel-2028{position:relative;overflow:hidden;border:1px solid rgba(130,165,255,.18);border-radius:26px;background:linear-gradient(135deg,rgba(16,31,58,.82),rgba(13,22,44,.74));box-shadow:0 26px 78px rgba(0,0,0,.27);}
.hero-main-2028{display:flex;gap:22px;align-items:flex-start;padding:30px;min-height:258px;}
.hero-main-2028:before,.copilot-panel-2028:before{content:"";position:absolute;inset:-40% -20% auto auto;width:360px;height:360px;background:radial-gradient(circle,rgba(116,72,255,.35),transparent 66%);pointer-events:none;}
.hero-logo-stack{position:relative;z-index:1;display:grid;place-items:center;min-width:94px;}
.hero-logo-orb{width:86px;height:86px;border-radius:28px;display:grid;place-items:center;font-size:30px;font-weight:950;color:#fff;letter-spacing:-.1em;background:linear-gradient(135deg,#22e7ff,#6d42ff 60%,#ff4fd8);box-shadow:0 0 42px rgba(88,121,255,.55),inset 0 1px 0 rgba(255,255,255,.45);}
.hero-pulse-dot{position:absolute;right:8px;bottom:2px;width:18px;height:18px;border-radius:50%;background:#21f6a2;box-shadow:0 0 0 9px rgba(33,246,162,.12),0 0 22px rgba(33,246,162,.7);}
.hero-copy-2028{position:relative;z-index:1;min-width:0;}
.eyebrow-2028{margin:0 0 10px!important;color:#7fe7ff!important;font-size:12px!important;font-weight:950;text-transform:uppercase;letter-spacing:.16em;}
.hero-copy-2028 h1{font-size:46px;line-height:1.03;margin:0 0 10px;letter-spacing:-.045em;}
.hero-subtitle-2028{max-width:880px!important;color:#b5c4e8!important;margin:0 0 8px!important;}
.command-actions-2028{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:18px;}
.scope-glass{display:flex;gap:8px;align-items:center;flex-wrap:wrap;background:rgba(6,14,28,.55);border:1px solid rgba(132,166,255,.18);border-radius:16px;padding:8px;}
.scope-glass select{min-height:42px;min-width:260px;}
.reset-compact-2028{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.reset-compact-2028 select{min-height:50px;border-radius:12px;}
.copilot-panel-2028{padding:26px;min-height:258px;}
.copilot-panel-2028 h2{margin:16px 0 10px;font-size:24px;}
.copilot-panel-2028 p{color:#b5c4e8;line-height:1.5;position:relative;z-index:1;}
.orb-visual{position:absolute;right:30px;top:78px;width:112px;height:112px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#fff,rgba(39,232,255,.75) 10%,rgba(118,67,255,.8) 42%,rgba(118,67,255,.18) 70%,transparent);box-shadow:0 0 55px rgba(103,85,255,.6);opacity:.92;}
.copilot-actions{position:relative;z-index:1;display:flex;gap:10px;flex-wrap:wrap;margin-top:20px;}
.kpi-strip-2028{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px;margin:18px 0;}
.kpi-card-2028{position:relative;overflow:hidden;min-height:132px;text-decoration:none;border:1px solid rgba(130,165,255,.18);border-radius:22px;background:linear-gradient(180deg,rgba(13,28,52,.82),rgba(11,22,42,.72));box-shadow:0 18px 55px rgba(0,0,0,.25);padding:18px;display:flex;flex-direction:column;gap:8px;}
.kpi-card-2028:after{content:"";position:absolute;left:18px;right:18px;bottom:12px;height:34px;background:linear-gradient(90deg,rgba(33,231,255,.05),rgba(33,231,255,.25),rgba(116,71,255,.08));clip-path:polygon(0 76%,12% 64%,22% 71%,35% 42%,48% 63%,60% 28%,73% 44%,86% 20%,100% 35%,100% 100%,0 100%);opacity:.75;}
.kpi-card-2028 span{color:#8fb2e8;font-size:13px;font-weight:900;}
.kpi-card-2028 strong{font-size:36px;color:#fff;letter-spacing:-.04em;z-index:1;}
.kpi-card-2028 em{font-style:normal;color:#91a4c6;font-size:12px;z-index:1;}
.kpi-card-2028.danger-glow{box-shadow:0 18px 55px rgba(239,68,68,.13);}
.kpi-card-2028.warn-glow{box-shadow:0 18px 55px rgba(245,158,11,.13);}
.kpi-card-2028.sent-glow{box-shadow:0 18px 55px rgba(59,130,246,.13);}
.kpi-card-2028.good-glow{box-shadow:0 18px 55px rgba(16,185,129,.13);}
.command-grid-2028{display:grid;grid-template-columns:1.2fr 1fr .9fr;gap:18px;margin:18px 0;}
.command-card-2028{margin:0!important;}
.ring-score{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;border:8px solid rgba(33,231,255,.24);background:rgba(33,231,255,.08);font-size:24px;font-weight:950;color:#fff;box-shadow:inset 0 0 20px rgba(33,231,255,.12),0 0 28px rgba(33,231,255,.12);}
.monitor-bars{display:grid;gap:16px;margin-top:16px;}
.monitor-bars div{display:grid;grid-template-columns:150px 1fr 70px;gap:12px;align-items:center;color:#a9b9d8;font-size:13px;}
.monitor-bars i{display:block;height:9px;border-radius:999px;background:rgba(132,166,255,.14);overflow:hidden;position:relative;}
.monitor-bars i:after{content:"";position:absolute;inset:0 auto 0 0;width:var(--w);border-radius:999px;background:linear-gradient(90deg,#21e7ff,#7c3cff);box-shadow:0 0 18px rgba(33,231,255,.35);}
.monitor-bars b{color:#fff;text-align:right;}
.quick-tile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px;}
.quick-tile-grid a{min-height:82px;text-decoration:none;border:1px solid rgba(132,166,255,.18);border-radius:18px;background:rgba(6,14,28,.46);display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding:14px;color:#dce9ff;font-weight:900;}
.quick-tile-grid a:hover{border-color:rgba(33,231,255,.45);background:rgba(33,231,255,.08);}
.quick-tile-grid span{font-size:24px;}
.doc-mix-list{display:grid;gap:12px;margin:16px 0;}
.doc-mix-list a{display:grid;grid-template-columns:18px 1fr auto;align-items:center;gap:10px;text-decoration:none;border:1px solid rgba(132,166,255,.16);border-radius:16px;background:rgba(6,14,28,.42);padding:13px;}
.doc-mix-list strong{color:#eaf3ff;}.doc-mix-list em{font-style:normal;font-weight:950;color:#fff;}
.doc-dot{width:12px;height:12px;border-radius:50%;display:inline-block;box-shadow:0 0 18px currentColor;}.doc-dot.calendar{background:#32d583;color:#32d583}.doc-dot.service{background:#38bdf8;color:#38bdf8}.doc-dot.appointment{background:#a78bfa;color:#a78bfa}
.status-legend-2028{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:18px 0!important;}
.status-legend-2028 strong{margin-right:4px;color:#fff;}
@media(max-width:1360px){.kpi-strip-2028{grid-template-columns:repeat(3,minmax(0,1fr));}.command-grid-2028,.command-hero-2028{grid-template-columns:1fr;}.orb-visual{opacity:.35}}
@media(max-width:760px){.kpi-strip-2028{grid-template-columns:repeat(2,minmax(0,1fr));}.hero-main-2028{flex-direction:column;padding:22px}.hero-copy-2028 h1{font-size:34px}.quick-tile-grid{grid-template-columns:1fr}.monitor-bars div{grid-template-columns:1fr}.monitor-bars b{text-align:left}.command-search input{min-width:0}}


/* Stage 6.6.19 — readability, weather, dashboard widgets, movable layout */
body.ui-2028 .upload-card,
body.ui-2028 .review-card,
body.ui-2028 .field-card,
body.ui-2028 .intake-field,
body.ui-2028 .review-field,
body.ui-2028 .form-panel,
body.ui-2028 .form-card,
body.ui-2028 .input-panel,
body.ui-2028 .panel,
body.ui-2028 .white-card,
body.ui-2028 .zip-preview-card,
body.ui-2028 .zip-upload-card,
body.ui-2028 .rules-panel,
body.ui-2028 .file-card,
body.ui-2028 .issue-card,
body.ui-2028 .meta-grid div,
body.ui-2028 .person-card,
body.ui-2028 details,
body.ui-2028 .support-panel,
body.ui-2028 .support-msg.bot,
body.ui-2028 .table-wrap,
body.ui-2028 .empty {
  background: linear-gradient(180deg, rgba(13,28,52,.92), rgba(9,20,38,.86)) !important;
  border-color: rgba(132,166,255,.24) !important;
  color: #eef7ff !important;
}
body.ui-2028 .upload-card *,
body.ui-2028 .review-card *,
body.ui-2028 .field-card *,
body.ui-2028 .intake-field *,
body.ui-2028 .review-field *,
body.ui-2028 .form-panel *,
body.ui-2028 .form-card *,
body.ui-2028 .input-panel *,
body.ui-2028 .panel *,
body.ui-2028 .white-card *,
body.ui-2028 .zip-preview-card *,
body.ui-2028 .zip-upload-card *,
body.ui-2028 .rules-panel *,
body.ui-2028 .file-card *,
body.ui-2028 .issue-card *,
body.ui-2028 .meta-grid div *,
body.ui-2028 .person-card *,
body.ui-2028 details *,
body.ui-2028 .support-panel *,
body.ui-2028 .empty * { color: inherit; }
body.ui-2028 label,
body.ui-2028 .meta-label,
body.ui-2028 .rule-title,
body.ui-2028 .file-title,
body.ui-2028 .issue-detail h3,
body.ui-2028 .form-label { color:#f7fbff!important; }
body.ui-2028 .muted,
body.ui-2028 .rule-help,
body.ui-2028 .small-text,
body.ui-2028 small,
body.ui-2028 .note { color:#aab9d8!important; }
body.ui-2028 .action-text,
body.ui-2028 .evidence { color:#d6e5ff!important; }
body.ui-2028 .issue-banner.warning { background:rgba(251,191,36,.14)!important;color:#ffe5a5!important;border-color:rgba(251,191,36,.35)!important; }
body.ui-2028 .issue-banner.error { background:rgba(239,68,68,.14)!important;color:#ffc0c0!important;border-color:rgba(239,68,68,.35)!important; }
body.ui-2028 .issue-banner.info { background:rgba(59,130,246,.14)!important;color:#bfdbfe!important;border-color:rgba(59,130,246,.35)!important; }
body.ui-2028 input, body.ui-2028 textarea, body.ui-2028 select {
  background: rgba(2,8,23,.82)!important;
  border-color: rgba(150,185,255,.34)!important;
  color: #f8fbff!important;
  caret-color: #63e6ff;
}
body.ui-2028 input:disabled, body.ui-2028 select:disabled, body.ui-2028 textarea:disabled { opacity:.72; }
body.ui-2028 .dropzone .btn, body.ui-2028 .btn.primary { color:#fff!important; }
body.ui-2028 .badge { color: inherit; }
body.ui-2028 .badge.warning { color:#7a4a00!important; }
body.ui-2028 .badge.error { color:#991b1b!important; }
body.ui-2028 .badge.info { color:#173e7a!important; }
body.ui-2028 .badge.complete, body.ui-2028 .badge.sent, body.ui-2028 .badge.open { color:#123!important; }
body.ui-2028 .sidebar .side-link, body.ui-2028 .sidebar .side-link * { color: inherit; }
body.ui-2028 .chat-web-toast, body.ui-2028 .chat-web-toast * { color:#fff!important; }
body.ui-2028 .support-msg.user { background:linear-gradient(135deg,#0ea5ff,#7247ff)!important;color:#fff!important; }
body.ui-2028 .pdf-page, body.ui-2028 .pdf-page * { color:#111827!important; }
.brand-mark-future{letter-spacing:0!important;}
.future-logo-orb svg{width:54px;height:54px;filter:drop-shadow(0 0 16px rgba(33,231,255,.5));}
.weather-panel-2028{position:relative;overflow:hidden;border:1px solid rgba(130,165,255,.18);border-radius:26px;background:linear-gradient(135deg,rgba(16,31,58,.82),rgba(13,22,44,.74));box-shadow:0 26px 78px rgba(0,0,0,.27);padding:26px;min-height:258px;}
.weather-panel-2028:before{content:"";position:absolute;right:-90px;top:-95px;width:260px;height:260px;border-radius:50%;background:radial-gradient(circle,rgba(33,231,255,.28),rgba(124,60,255,.18) 44%,transparent 70%);}
.weather-panel-2028 h2{margin:16px 0 14px;font-size:24px;color:#f7fbff;position:relative;z-index:1;}
.weather-live{position:relative;z-index:1;display:flex;gap:18px;align-items:center;margin:14px 0 18px;}
.weather-temp{width:112px;height:112px;border-radius:36px;display:grid;place-items:center;font-size:36px;font-weight:950;color:#fff;background:radial-gradient(circle at 30% 25%,#fff 0,#60efff 8%,#6e45ff 52%,#0b1a32 100%);box-shadow:0 0 52px rgba(111,69,255,.42);}
.weather-live strong{display:block;color:#fff;font-size:17px;margin-bottom:4px;}
.weather-live p{margin:0;color:#b5c4e8;line-height:1.45;}
.weather-mini-grid{position:relative;z-index:1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:16px;}
.weather-mini-grid span{border:1px solid rgba(132,166,255,.18);border-radius:16px;background:rgba(6,14,28,.46);padding:12px;display:grid;gap:4px;}
.weather-mini-grid b{color:#fff;font-size:17px;}.weather-mini-grid small{color:#9fb0d1!important;text-transform:uppercase;font-weight:900;font-size:10px;letter-spacing:.08em;}
.workflow-donut-card{min-height:260px;}
.donut-layout-2028{display:flex;align-items:center;gap:22px;margin:14px 0 16px;}
.donut-2028{--open:0;--sent:0;width:148px;height:148px;border-radius:50%;display:grid;place-items:center;position:relative;background:conic-gradient(#f59e0b 0 calc(var(--open)*1%), #3b82f6 calc(var(--open)*1%) calc((var(--open) + var(--sent))*1%), #22c55e calc((var(--open) + var(--sent))*1%) 100%);box-shadow:0 0 42px rgba(33,231,255,.14);}
.donut-2028:after{content:"";position:absolute;inset:22px;border-radius:50%;background:#07111f;border:1px solid rgba(132,166,255,.16);}
.donut-2028 strong,.donut-2028 span{position:relative;z-index:1;grid-area:1/1;}.donut-2028 strong{font-size:34px;color:#fff;margin-top:-18px}.donut-2028 span{font-size:12px;color:#9fb0d1;margin-top:34px;font-weight:800;}
.donut-legend-2028{display:grid;gap:12px;}.donut-legend-2028 span{display:flex;gap:9px;align-items:center;color:#dce9ff;font-weight:800}.donut-legend-2028 i{width:12px;height:12px;border-radius:4px;display:inline-block}.donut-legend-2028 .open{background:#f59e0b}.donut-legend-2028 .sent{background:#3b82f6}.donut-legend-2028 .done{background:#22c55e}.subtle-link{color:#8fdcff;text-decoration:none;font-weight:900;}
.drag-handle{display:none;position:absolute;right:14px;top:12px;z-index:5;cursor:grab;user-select:none;padding:5px 7px;border-radius:10px;background:rgba(33,231,255,.1);border:1px solid rgba(33,231,255,.2);color:#9beeff!important;font-weight:950;letter-spacing:-.12em;}
[data-dash-widget]{position:relative;}
body.dashboard-customizing [data-dash-widget]{outline:1px dashed rgba(33,231,255,.4);outline-offset:4px;cursor:grab;}
body.dashboard-customizing .drag-handle{display:inline-flex;align-items:center;justify-content:center;}
.dragging-dashboard-card{opacity:.45;transform:scale(.99);}
.customize-dashboard-btn{border-color:rgba(33,231,255,.3)!important;color:#bdf7ff!important;background:rgba(33,231,255,.08)!important;}
@media(max-width:980px){.weather-live,.donut-layout-2028{flex-direction:column;align-items:flex-start}.weather-mini-grid{grid-template-columns:1fr}.donut-2028{width:130px;height:130px}}

/* Stage 6.6.21 — page-by-page 2028 dark UI polish + safe dashboard layout editor */
body.ui-2028 {
  --surface-2028: rgba(10, 22, 42, .92);
  --surface-2028-2: rgba(14, 29, 54, .88);
  --surface-2028-3: rgba(18, 36, 66, .78);
  --line-2028: rgba(132, 166, 255, .24);
  --text-2028: #f2f8ff;
  --muted-2028: #a9bad9;
  --cyan-2028: #42e8ff;
  --purple-2028: #7c5cff;
}
body.ui-2028 .card,
body.ui-2028 .upload-card,
body.ui-2028 .rules-status,
body.ui-2028 .batch-name-panel,
body.ui-2028 .super-admin-upload-panel,
body.ui-2028 .upload-safety-note,
body.ui-2028 .rules-panel,
body.ui-2028 .rule-box,
body.ui-2028 .issues-card,
body.ui-2028 .issue-card,
body.ui-2028 .issue-middle .meta-grid > div,
body.ui-2028 .status-form,
body.ui-2028 .file-card,
body.ui-2028 .person-card,
body.ui-2028 .summary-card,
body.ui-2028 .table-wrap,
body.ui-2028 .zip-upload-card,
body.ui-2028 .zip-preview-card,
body.ui-2028 .field-card,
body.ui-2028 .review-card,
body.ui-2028 .review-field,
body.ui-2028 .intake-field,
body.ui-2028 .form-card,
body.ui-2028 .form-panel,
body.ui-2028 .white-card,
body.ui-2028 .panel,
body.ui-2028 .notice,
body.ui-2028 details,
body.ui-2028 .empty {
  background: linear-gradient(180deg, var(--surface-2028), rgba(7, 17, 31, .9)) !important;
  color: var(--text-2028) !important;
  border-color: var(--line-2028) !important;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .22) !important;
}
body.ui-2028 .rules-status h2,
body.ui-2028 .rules-status p,
body.ui-2028 .rules-status strong,
body.ui-2028 .batch-name-panel label,
body.ui-2028 .batch-name-panel span,
body.ui-2028 .batch-name-panel p,
body.ui-2028 .upload-safety-note,
body.ui-2028 .upload-safety-note strong,
body.ui-2028 .field-label,
body.ui-2028 .rule-title,
body.ui-2028 .issue-card h3,
body.ui-2028 .issue-card strong,
body.ui-2028 .issue-card p,
body.ui-2028 .issue-card a,
body.ui-2028 .chat-panel,
body.ui-2028 .chat-panel *,
body.ui-2028 .table-wrap table,
body.ui-2028 .table-wrap td,
body.ui-2028 .table-wrap th,
body.ui-2028 .file-card *,
body.ui-2028 .person-card * {
  color: inherit;
}
body.ui-2028 .muted,
body.ui-2028 .rule-help,
body.ui-2028 .small-text,
body.ui-2028 .small-muted,
body.ui-2028 .note,
body.ui-2028 .active-filter-label,
body.ui-2028 .drop-subtitle,
body.ui-2028 .drop-file-summary,
body.ui-2028 .chat-status-line {
  color: var(--muted-2028) !important;
}
body.ui-2028 .rules-status,
body.ui-2028 .batch-name-panel,
body.ui-2028 .upload-safety-note {
  border-radius: 22px !important;
}
body.ui-2028 .dropzone,
body.ui-2028 .chat-dropzone {
  background: radial-gradient(circle at top, rgba(33, 231, 255, .08), rgba(8, 20, 39, .92)) !important;
  border: 1.5px dashed rgba(66, 232, 255, .42) !important;
  color: var(--text-2028) !important;
  border-radius: 24px !important;
}
body.ui-2028 .dropzone:hover,
body.ui-2028 .dropzone.is-dragover,
body.ui-2028 .chat-dropzone:hover,
body.ui-2028 .chat-dropzone.dragover {
  background: radial-gradient(circle at top, rgba(124, 92, 255, .18), rgba(8, 20, 39, .94)) !important;
  border-color: rgba(66, 232, 255, .82) !important;
  box-shadow: 0 0 0 4px rgba(66, 232, 255, .08), 0 18px 44px rgba(0, 0, 0, .25) !important;
}
body.ui-2028 .drop-title,
body.ui-2028 .drop-icon,
body.ui-2028 .chat-dropzone strong { color: #f8fcff !important; }
body.ui-2028 .drop-browse,
body.ui-2028 input::file-selector-button {
  background: linear-gradient(135deg, #0ea5ff, #7247ff) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 14px !important;
  font-weight: 950 !important;
  padding: 10px 15px !important;
  box-shadow: 0 12px 28px rgba(31, 111, 255, .28) !important;
}
body.ui-2028 input,
body.ui-2028 textarea,
body.ui-2028 select,
body.ui-2028 .text-input.big-input,
body.ui-2028 .status-form input,
body.ui-2028 .status-form select {
  background: rgba(5, 13, 27, .94) !important;
  border: 1px solid rgba(145, 180, 255, .38) !important;
  color: #f8fbff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
}
body.ui-2028 input::placeholder,
body.ui-2028 textarea::placeholder { color: #8fa3c4 !important; }
body.ui-2028 input[type="checkbox"] { accent-color: #42e8ff; box-shadow: none !important; }
body.ui-2028 input:disabled,
body.ui-2028 textarea:disabled,
body.ui-2028 select:disabled { opacity: .82 !important; }
body.ui-2028 .btn,
body.ui-2028 button.btn,
body.ui-2028 a.btn,
body.ui-2028 .tab-btn,
body.ui-2028 .icon-btn {
  border-radius: 15px !important;
  border: 1px solid rgba(132, 166, 255, .25) !important;
  background: linear-gradient(180deg, rgba(25, 45, 80, .96), rgba(10, 22, 42, .96)) !important;
  color: #f7fbff !important;
  font-weight: 950 !important;
  box-shadow: 0 12px 26px rgba(0,0,0,.20) !important;
}
body.ui-2028 .btn:hover,
body.ui-2028 .tab-btn:hover,
body.ui-2028 .tab-btn.active {
  background: linear-gradient(135deg, #0ea5ff, #7247ff) !important;
  color: #fff !important;
  border-color: rgba(66,232,255,.55) !important;
  transform: translateY(-1px);
}
body.ui-2028 .btn.primary,
body.ui-2028 .tab-btn.active {
  background: linear-gradient(135deg, #0ea5ff, #7247ff) !important;
  color: #fff !important;
}
body.ui-2028 .btn.danger,
body.ui-2028 .danger {
  background: linear-gradient(135deg, rgba(239,68,68,.95), rgba(127,29,29,.95)) !important;
  color: #fff !important;
  border-color: rgba(248,113,113,.48) !important;
}
body.ui-2028 .badge {
  border: 1px solid rgba(255,255,255,.12) !important;
  font-weight: 950 !important;
  color: #061426 !important;
}
body.ui-2028 .badge.warning { background: #fde68a !important; color: #4a2a00 !important; }
body.ui-2028 .badge.error { background: #fecaca !important; color: #7f1d1d !important; }
body.ui-2028 .badge.info { background: #bfdbfe !important; color: #0f3b73 !important; }
body.ui-2028 .badge.open { background: #e0e7ff !important; color: #1e1b4b !important; }
body.ui-2028 .badge.sent { background: #dbeafe !important; color: #1e3a8a !important; }
body.ui-2028 .badge.complete { background: #bbf7d0 !important; color: #064e3b !important; }
body.ui-2028 .issue-card {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 170px;
  gap: 18px;
  border-left: 6px solid #f59e0b !important;
}
body.ui-2028 .issue-card.error { border-left-color: #ef4444 !important; }
body.ui-2028 .issue-card.info { border-left-color: #3b82f6 !important; }
body.ui-2028 .issue-left,
body.ui-2028 .issue-middle,
body.ui-2028 .issue-right { color: var(--text-2028) !important; }
body.ui-2028 .issue-detail,
body.ui-2028 .clickable-panel {
  background: rgba(4, 12, 26, .26) !important;
  border-radius: 16px !important;
  padding: 12px !important;
}
body.ui-2028 .evidence { color: #dbeafe !important; }
body.ui-2028 .action-text { color: #e0f2fe !important; }
body.ui-2028 .status-form {
  background: linear-gradient(180deg, rgba(7,17,31,.92), rgba(4,12,26,.92)) !important;
  border-radius: 18px !important;
}
body.ui-2028 .status-form label span,
body.ui-2028 .meta-label {
  color: #9bbcff !important;
  letter-spacing: .08em;
}
body.ui-2028 .status-form input[name="note"] { background: rgba(5, 13, 27, .92) !important; }
body.ui-2028 .table-wrap { overflow: auto; }
body.ui-2028 table { border-collapse: separate; border-spacing: 0; }
body.ui-2028 th { background: rgba(6, 14, 28, .96) !important; color: #b9d4ff !important; }
body.ui-2028 td { color: #edf7ff !important; }
body.ui-2028 tr:hover td { background: rgba(33,231,255,.05) !important; }
body.ui-2028 .chat-shell { align-items: stretch !important; }
body.ui-2028 .chat-panel,
body.ui-2028 .chat-main-head,
body.ui-2028 .chat-side-head,
body.ui-2028 .chat-tools-head,
body.ui-2028 .chat-compose {
  background: linear-gradient(180deg, rgba(12, 27, 50, .96), rgba(6, 14, 28, .94)) !important;
  color: #f2f8ff !important;
  border-color: rgba(132, 166, 255, .24) !important;
}
body.ui-2028 .chat-messages {
  background: radial-gradient(circle at top right, rgba(33,231,255,.08), transparent 28rem), rgba(5, 13, 27, .82) !important;
  color: #f2f8ff !important;
}
body.ui-2028 .chat-msg {
  background: linear-gradient(180deg, rgba(15, 32, 61, .96), rgba(9, 20, 38, .96)) !important;
  border-color: rgba(132, 166, 255, .24) !important;
  color: #f2f8ff !important;
}
body.ui-2028 .chat-msg.mine { background: linear-gradient(135deg, rgba(14,165,255,.22), rgba(114,71,255,.22)) !important; border-color: rgba(66,232,255,.38) !important; }
body.ui-2028 .chat-msg.mentions-me { background: linear-gradient(135deg, rgba(34,246,162,.20), rgba(14,165,255,.16)) !important; border-color: rgba(34,246,162,.55) !important; }
body.ui-2028 .chat-msg.deleted,
body.ui-2028 .chat-msg.cleared { background: linear-gradient(180deg, rgba(127,29,29,.52), rgba(55,12,22,.64)) !important; border-color: rgba(248,113,113,.55) !important; color:#fff !important; }
body.ui-2028 .chat-msg-meta { color: #9fb0d1 !important; }
body.ui-2028 .chat-row-link,
body.ui-2028 .chat-person,
body.ui-2028 .chat-reply-card,
body.ui-2028 .chat-reply-compose,
body.ui-2028 .notice.soft {
  background: rgba(5, 13, 27, .72) !important;
  border-color: rgba(132, 166, 255, .24) !important;
  color: #f2f8ff !important;
}
body.ui-2028 .chat-row-link.active,
body.ui-2028 .chat-row-link:hover {
  background: linear-gradient(135deg, rgba(14,165,255,.22), rgba(114,71,255,.18)) !important;
  border-color: rgba(66,232,255,.45) !important;
}
body.ui-2028 .chat-attachment,
body.ui-2028 .chat-attachment-img {
  background: rgba(5,13,27,.8) !important;
  border-color: rgba(132,166,255,.24) !important;
  color:#eaf6ff !important;
}
body.ui-2028 .support-panel,
body.ui-2028 .support-msg.bot { background: var(--surface-2028) !important; color:#f2f8ff !important; border-color: var(--line-2028) !important; }
body.dashboard-customizing [data-dash-widget] { outline: 2px dashed rgba(66,232,255,.58) !important; outline-offset: 6px !important; cursor: default !important; }
body.dashboard-customizing .drag-handle { display:inline-flex !important; cursor: grab !important; }
body.dashboard-customizing .drag-handle:active { cursor: grabbing !important; }
.dashboard-drag-placeholder {
  border: 2px dashed rgba(66,232,255,.65);
  border-radius: 22px;
  background: rgba(66,232,255,.08);
  min-height: 86px;
  margin: 12px 0;
  box-shadow: inset 0 0 22px rgba(66,232,255,.08);
}
.dragging-dashboard-card { opacity:.42 !important; transform: scale(.985); }
.drag-handle {
  background: linear-gradient(135deg, rgba(14,165,255,.26), rgba(114,71,255,.26)) !important;
  border-color: rgba(66,232,255,.42) !important;
  color: #c9fbff !important;
}
@media(max-width:980px){
  body.ui-2028 .issue-card{grid-template-columns:1fr;}
}

/* Stage 6.6.21 - page-by-page 2028 readability polish and dashboard drag safety */
body.ui-2028 {
  --surface-2028-strong: rgba(9, 20, 38, .96);
  --surface-2028-soft: rgba(13, 28, 52, .84);
  --surface-2028-input: rgba(4, 12, 26, .92);
  --text-2028-strong: #f8fcff;
  --text-2028-soft: #c7d7f4;
  --text-2028-muted: #93a8cb;
}
body.ui-2028 .app-container { color: var(--text-2028-strong) !important; }
body.ui-2028 .hero,
body.ui-2028 .hero.compact,
body.ui-2028 .results-hero {
  color: var(--text-2028-strong) !important;
}
body.ui-2028 .hero p,
body.ui-2028 .results-hero p,
body.ui-2028 .hero .muted { color: var(--text-2028-soft) !important; }

/* Generic white-card rescue for older templates that still use light blocks */
body.ui-2028 .card,
body.ui-2028 .communication-card,
body.ui-2028 .issues-card,
body.ui-2028 .plain-text-details,
body.ui-2028 .preview-intro-card,
body.ui-2028 .preview-subject-card,
body.ui-2028 .preview-summary-card > div,
body.ui-2028 .preview-issue-card,
body.ui-2028 .preview-meta-grid > div,
body.ui-2028 .preview-block,
body.ui-2028 .correction-report-preview,
body.ui-2028 .article-card,
body.ui-2028 .article-card.featured,
body.ui-2028 .help-chip,
body.ui-2028 .article-visual-mini span,
body.ui-2028 .visual-guide,
body.ui-2028 .visual-screen,
body.ui-2028 .next-action-box,
body.ui-2028 .support-request-card,
body.ui-2028 .support-question,
body.ui-2028 .support-answer,
body.ui-2028 .stat-card,
body.ui-2028 .metric-card,
body.ui-2028 .audit-match-card,
body.ui-2028 .audit-summary-grid > div,
body.ui-2028 .wide-admin-table,
body.ui-2028 .review-field,
body.ui-2028 .field-card,
body.ui-2028 .extra-card,
body.ui-2028 .case-card,
body.ui-2028 .zip-card,
body.ui-2028 .zip-section,
body.ui-2028 .white-panel,
body.ui-2028 .light-panel {
  background: linear-gradient(180deg, rgba(13, 28, 52, .95), rgba(6, 15, 31, .94)) !important;
  color: var(--text-2028-strong) !important;
  border-color: rgba(128, 166, 255, .27) !important;
  box-shadow: 0 18px 55px rgba(0,0,0,.25) !important;
}
body.ui-2028 .card *,
body.ui-2028 .communication-card *,
body.ui-2028 .issues-card *,
body.ui-2028 .plain-text-details *,
body.ui-2028 .correction-report-preview *,
body.ui-2028 .article-card *,
body.ui-2028 .help-chip,
body.ui-2028 .support-request-card *,
body.ui-2028 .stat-card *,
body.ui-2028 .metric-card *,
body.ui-2028 .audit-match-card *,
body.ui-2028 .review-field *,
body.ui-2028 .field-card * { color: inherit; }
body.ui-2028 .article-card p,
body.ui-2028 .preview-label,
body.ui-2028 .preview-summary-card span,
body.ui-2028 .preview-meta-grid span,
body.ui-2028 .preview-block span,
body.ui-2028 .stat-card span,
body.ui-2028 .visual-body,
body.ui-2028 .support-head p,
body.ui-2028 .support-question p,
body.ui-2028 .support-answer p {
  color: var(--text-2028-soft) !important;
}
body.ui-2028 .article-category,
body.ui-2028 .preview-count-badge {
  background: rgba(33,231,255,.12) !important;
  color: #b9f7ff !important;
  border: 1px solid rgba(33,231,255,.25) !important;
}

/* Forms, file inputs, upload/drop zones */
body.ui-2028 .stack-form,
body.ui-2028 .send-form,
body.ui-2028 .support-request-form,
body.ui-2028 .help-search-form,
body.ui-2028 .compact-form {
  display: grid !important;
  gap: 16px !important;
}
body.ui-2028 .stack-form > label,
body.ui-2028 .send-form > label,
body.ui-2028 .compact-form > label {
  display: grid !important;
  gap: 7px !important;
  color: var(--text-2028-strong) !important;
  font-weight: 850 !important;
}
body.ui-2028 .stack-form > label span,
body.ui-2028 .send-form label span,
body.ui-2028 .form-grid label,
body.ui-2028 .support-update-form label {
  color: #b8c8ea !important;
}
body.ui-2028 .upload-zone,
body.ui-2028 .audit-zone,
body.ui-2028 .dropzone,
body.ui-2028 .chat-dropzone {
  background: radial-gradient(circle at top, rgba(33,231,255,.10), rgba(6,15,31,.94) 52%) !important;
  border: 1.5px dashed rgba(66,232,255,.48) !important;
  color: var(--text-2028-strong) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 40px rgba(0,0,0,.18) !important;
}
body.ui-2028 .upload-zone h3,
body.ui-2028 .upload-zone p,
body.ui-2028 .upload-zone .muted,
body.ui-2028 .audit-zone h3,
body.ui-2028 .audit-zone p,
body.ui-2028 .audit-zone .muted {
  color: var(--text-2028-soft) !important;
}
body.ui-2028 .upload-zone h3,
body.ui-2028 .audit-zone h3 { color: var(--text-2028-strong) !important; }
body.ui-2028 .upload-zone.drag-active,
body.ui-2028 .audit-zone.drag-active,
body.ui-2028 .dropzone.is-dragover,
body.ui-2028 .chat-dropzone.dragover {
  background: radial-gradient(circle at top, rgba(114,71,255,.22), rgba(6,15,31,.96) 56%) !important;
  border-color: rgba(66,232,255,.88) !important;
}
body.ui-2028 input,
body.ui-2028 textarea,
body.ui-2028 select,
body.ui-2028 input[type="file"] {
  background: var(--surface-2028-input) !important;
  color: var(--text-2028-strong) !important;
  border-color: rgba(145, 180, 255, .40) !important;
  border-radius: 14px !important;
}
body.ui-2028 input[type="file"] { padding: 10px !important; }
body.ui-2028 input::file-selector-button {
  margin-right: 12px !important;
}
body.ui-2028 .intake-processing,
body.ui-2028 .audit-processing {
  background: rgba(7,17,31,.92) !important;
  border-color: rgba(128,166,255,.28) !important;
  color: var(--text-2028-strong) !important;
}
body.ui-2028 .intake-progress,
body.ui-2028 .audit-progress { background: rgba(4,12,26,.9) !important; border-color: rgba(128,166,255,.25) !important; }
body.ui-2028 .intake-steps,
body.ui-2028 .audit-steps { color: var(--text-2028-soft) !important; }

/* Report/email preview professional dark mode */
body.ui-2028 .preview-ai-note {
  background: rgba(234,179,8,.12) !important;
  border-color: rgba(234,179,8,.45) !important;
  color: #ffe8a7 !important;
}
body.ui-2028 .preview-issue-card.severity-warning { border-left-color: #f59e0b !important; }
body.ui-2028 .preview-issue-card.severity-error { border-left-color: #ef4444 !important; }
body.ui-2028 .preview-block.problem { background: rgba(239,68,68,.10) !important; border-color: rgba(248,113,113,.38) !important; }
body.ui-2028 .preview-block.evidence { background: rgba(59,130,246,.10) !important; border-color: rgba(96,165,250,.38) !important; }
body.ui-2028 .preview-block.action { background: rgba(34,197,94,.10) !important; border-color: rgba(74,222,128,.38) !important; }
body.ui-2028 .packet-attach-note,
body.ui-2028 .message-box {
  background: rgba(7,17,31,.90) !important;
  border-color: rgba(128,166,255,.26) !important;
  color: var(--text-2028-strong) !important;
}

/* Help Center / Support Inbox */
body.ui-2028 .help-quick-grid { gap: 12px !important; }
body.ui-2028 .help-chip {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 36px !important;
  color: #e8f6ff !important;
  text-decoration: none !important;
}
body.ui-2028 .article-card { min-height: 190px; }
body.ui-2028 .article-card .btn { margin-top: 10px; }
body.ui-2028 .stat-grid { align-items: stretch; }
body.ui-2028 .stat-card strong { color: #f8fcff !important; }
body.ui-2028 .support-request-top { border-color: rgba(128,166,255,.22) !important; }

/* Internal Chat 2028 cleanup */
body.ui-2028 .chat-shell {
  grid-template-columns: minmax(260px, 320px) minmax(520px, 1fr) minmax(250px, 300px) !important;
  gap: 18px !important;
  align-items: stretch !important;
}
body.ui-2028 .chat-side,
body.ui-2028 .chat-tools,
body.ui-2028 .chat-main,
body.ui-2028 .chat-panel {
  background: linear-gradient(180deg, rgba(13,28,52,.94), rgba(6,15,31,.94)) !important;
  border: 1px solid rgba(128,166,255,.26) !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  color: var(--text-2028-strong) !important;
  box-shadow: 0 18px 55px rgba(0,0,0,.22) !important;
}
body.ui-2028 .chat-side-head,
body.ui-2028 .chat-tools-head,
body.ui-2028 .chat-main-head,
body.ui-2028 .chat-compose {
  background: rgba(5,13,27,.86) !important;
  border-color: rgba(128,166,255,.22) !important;
  color: var(--text-2028-strong) !important;
}
body.ui-2028 .chat-side-body,
body.ui-2028 .chat-tools-body { background: transparent !important; color: var(--text-2028-strong) !important; }
body.ui-2028 .chat-messages {
  background: radial-gradient(circle at top right, rgba(33,231,255,.08), transparent 30rem), rgba(4,12,26,.74) !important;
}
body.ui-2028 .chat-person,
body.ui-2028 .chat-row-link,
body.ui-2028 .notice.soft {
  background: rgba(7,17,31,.78) !important;
  color: var(--text-2028-strong) !important;
  border-color: rgba(128,166,255,.24) !important;
}
body.ui-2028 .chat-person small,
body.ui-2028 .chat-row-link small,
body.ui-2028 .notice.soft { color: var(--text-2028-soft) !important; }
@media(max-width:1200px){ body.ui-2028 .chat-shell{grid-template-columns:1fr!important;} }

/* Dashboard customize: safer, obvious handles and no accidental navigation */
body.dashboard-customizing [data-dash-widget] {
  outline: 2px dashed rgba(66,232,255,.55) !important;
  outline-offset: 6px !important;
  cursor: default !important;
}
body.dashboard-customizing [data-dash-widget]::after {
  content: "Drag by MOVE handle";
  position: absolute;
  right: 14px;
  bottom: 10px;
  color: rgba(185,247,255,.72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  pointer-events: none;
}
body.dashboard-customizing .drag-handle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 74px !important;
  height: 34px !important;
  padding: 0 11px !important;
  right: 12px !important;
  top: 10px !important;
  border-radius: 999px !important;
  cursor: grab !important;
  letter-spacing: 0 !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  color: #effdff !important;
  background: linear-gradient(135deg, rgba(14,165,255,.9), rgba(114,71,255,.9)) !important;
  border: 1px solid rgba(177,244,255,.55) !important;
  box-shadow: 0 10px 24px rgba(14,165,255,.24) !important;
  z-index: 20 !important;
  pointer-events: auto !important;
}
body.dashboard-customizing .drag-handle::before { content: "MOVE"; margin-right: 6px; }
body.dashboard-customizing .drag-handle:active { cursor: grabbing !important; }
.dashboard-drag-placeholder {
  min-height: 96px !important;
  border: 2px dashed rgba(66,232,255,.82) !important;
  background: rgba(66,232,255,.10) !important;
  border-radius: 24px !important;
}
body.dashboard-customizing .kpi-card-2028,
body.dashboard-customizing .quick-tile { user-select: none; }

/* Strong button consistency */
body.ui-2028 .btn,
body.ui-2028 button,
body.ui-2028 .drop-browse,
body.ui-2028 .audit-tab,
body.ui-2028 .help-chip,
body.ui-2028 input::file-selector-button {
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease !important;
}
body.ui-2028 .btn.primary,
body.ui-2028 button[type="submit"],
body.ui-2028 .drop-browse,
body.ui-2028 input::file-selector-button {
  background: linear-gradient(135deg, #0ea5ff, #7247ff) !important;
  border-color: rgba(66,232,255,.45) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 32px rgba(31,111,255,.26) !important;
}
body.ui-2028 .btn:hover,
body.ui-2028 button:hover,
body.ui-2028 .help-chip:hover,
body.ui-2028 .article-card:hover {
  transform: translateY(-1px);
  border-color: rgba(66,232,255,.60) !important;
}

/* Stage 6.6.22 — Final 2028 polish for AUDIT, Correction Report, and movable dashboard */
body.ui-2028 {
  --panel-2028: rgba(8, 19, 36, .88);
  --panel-2028-2: rgba(12, 28, 52, .92);
  --panel-border-2028: rgba(92, 142, 255, .28);
  --text-2028-strong: #f4fbff;
  --text-2028: #dceaff;
  --text-2028-soft: #a9bcda;
  --field-2028: rgba(5, 14, 27, .92);
  --field-border-2028: rgba(120, 166, 255, .36);
}
body.ui-2028 .muted,
body.ui-2028 .small-text,
body.ui-2028 small,
body.ui-2028 .help-text,
body.ui-2028 .hint,
body.ui-2028 .text-muted { color: var(--text-2028-soft) !important; }
body.ui-2028 label,
body.ui-2028 label span,
body.ui-2028 .form-label,
body.ui-2028 th,
body.ui-2028 td,
body.ui-2028 p,
body.ui-2028 li { color: var(--text-2028) !important; }
body.ui-2028 h1,
body.ui-2028 h2,
body.ui-2028 h3,
body.ui-2028 h4,
body.ui-2028 strong { color: var(--text-2028-strong) !important; }
body.ui-2028 input,
body.ui-2028 textarea,
body.ui-2028 select {
  background: var(--field-2028) !important;
  color: var(--text-2028-strong) !important;
  border: 1px solid var(--field-border-2028) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body.ui-2028 input::placeholder,
body.ui-2028 textarea::placeholder { color: #91a7ca !important; opacity: 1 !important; }
body.ui-2028 input:focus,
body.ui-2028 textarea:focus,
body.ui-2028 select:focus { border-color: rgba(35, 230, 255, .70) !important; box-shadow: 0 0 0 4px rgba(35,230,255,.10) !important; outline: none !important; }
body.ui-2028 .card,
body.ui-2028 .panel,
body.ui-2028 .section,
body.ui-2028 .box,
body.ui-2028 .form-card,
body.ui-2028 .audit-card,
body.ui-2028 .support-card,
body.ui-2028 .article-card,
body.ui-2028 .stat-card,
body.ui-2028 .summary-card,
body.ui-2028 .notice:not(.warning):not(.danger):not(.success),
body.ui-2028 .alert:not(.warning):not(.danger):not(.success) {
  background: linear-gradient(135deg, rgba(10,24,44,.92), rgba(7,16,31,.88)) !important;
  color: var(--text-2028) !important;
  border-color: var(--panel-border-2028) !important;
}
body.ui-2028 table,
body.ui-2028 .table,
body.ui-2028 .table-wrap,
body.ui-2028 .results-table,
body.ui-2028 .preview-table {
  background: rgba(5,14,27,.82) !important;
  color: var(--text-2028) !important;
  border-color: rgba(120,166,255,.24) !important;
}
body.ui-2028 tr,
body.ui-2028 tbody tr,
body.ui-2028 thead tr { border-color: rgba(120,166,255,.18) !important; }
body.ui-2028 thead,
body.ui-2028 th { background: rgba(18,38,70,.92) !important; color: #dbeafe !important; }
body.ui-2028 tbody tr:hover { background: rgba(35,230,255,.055) !important; }

/* Dashboard layout editor: pointer-based drag, no accidental navigation. */
body.dashboard-customizing { cursor: default !important; }
body.dashboard-customizing [data-dash-widget] {
  position: relative !important;
  outline: 2px dashed rgba(66,232,255,.72) !important;
  outline-offset: 7px !important;
  cursor: default !important;
  user-select: none !important;
}
body.dashboard-customizing [data-dash-widget] a,
body.dashboard-customizing [data-dash-widget] button:not(.drag-handle),
body.dashboard-customizing [data-dash-widget] select,
body.dashboard-customizing [data-dash-widget] input { pointer-events: none !important; }
body.dashboard-customizing .drag-handle {
  pointer-events: auto !important;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: grab !important;
  min-width: 86px !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  background: linear-gradient(135deg, #13c8ff, #7c4dff) !important;
  border: 1px solid rgba(200,250,255,.65) !important;
  border-radius: 999px !important;
  box-shadow: 0 14px 30px rgba(48,150,255,.32) !important;
  z-index: 80 !important;
}
body.dashboard-customizing .drag-handle::before { content: "MOVE"; margin-right: 7px; font-weight: 950; }
body.dashboard-dragging-active { cursor: grabbing !important; }
body.dashboard-dragging-active .dragging-dashboard-card {
  opacity: .94 !important;
  transform: scale(1.015) rotate(.15deg) !important;
  box-shadow: 0 28px 80px rgba(0,0,0,.44), 0 0 0 1px rgba(66,232,255,.44) !important;
}
.dashboard-drag-placeholder {
  min-height: 104px !important;
  border: 2px dashed rgba(66,232,255,.90) !important;
  background: rgba(66,232,255,.12) !important;
  border-radius: 24px !important;
  box-shadow: inset 0 0 40px rgba(66,232,255,.10) !important;
}
.dashboard-drag-placeholder.kpi-placeholder { min-height: 120px !important; }
body.dashboard-customizing .customize-dashboard-btn { background: linear-gradient(135deg, #19d2ff, #7f54ff) !important; color: #fff !important; }

/* AUDIT / Humana upload screen */
body.ui-2028 .audit-tabs .audit-tab,
body.ui-2028 .audit-tab {
  background: rgba(8, 20, 38, .94) !important;
  color: #dceaff !important;
  border: 1px solid rgba(96,165,250,.30) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.18) !important;
}
body.ui-2028 .audit-tabs .audit-tab.active,
body.ui-2028 .audit-tab.active { background: linear-gradient(135deg,#0ea5ff,#7247ff) !important; color: white !important; }
body.ui-2028 .audit-section-head,
body.ui-2028 .audit-form-grid,
body.ui-2028 .audit-upload-grid { color: var(--text-2028) !important; }
body.ui-2028 .upload-zone,
body.ui-2028 .audit-zone,
body.ui-2028 .intake-drop,
body.ui-2028 .zip-dropzone,
body.ui-2028 .dropzone,
body.ui-2028 .drop-zone {
  background: radial-gradient(circle at top, rgba(14,165,255,.13), rgba(5,14,27,.86) 48%, rgba(3,10,20,.92)) !important;
  color: var(--text-2028) !important;
  border: 1.5px dashed rgba(35,230,255,.44) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 16px 42px rgba(0,0,0,.18) !important;
}
body.ui-2028 .upload-zone.drag-active,
body.ui-2028 .audit-zone.drag-active,
body.ui-2028 .intake-drop.drag-active {
  background: radial-gradient(circle at top, rgba(34,211,238,.24), rgba(10,24,44,.92)) !important;
  border-color: rgba(34,211,238,.95) !important;
  box-shadow: 0 0 0 4px rgba(34,211,238,.12), 0 24px 60px rgba(14,165,255,.18) !important;
}
body.ui-2028 .upload-zone h3,
body.ui-2028 .audit-zone h3 { color: #f7fbff !important; }
body.ui-2028 .upload-zone p,
body.ui-2028 .audit-zone p { color: #bdd2f0 !important; }
body.ui-2028 .drop-hint,
body.ui-2028 .file-list,
body.ui-2028 .selected-files,
body.ui-2028 .file-name,
body.ui-2028 .no-files {
  background: rgba(4,12,25,.88) !important;
  color: #dceaff !important;
  border: 1px solid rgba(120,166,255,.32) !important;
  border-radius: 14px !important;
}
body.ui-2028 .drop-hint {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px 18px !important;
  color: #e8f7ff !important;
  background: linear-gradient(135deg, rgba(14,165,255,.22), rgba(124,77,255,.20)) !important;
}
body.ui-2028 input[type="file"] {
  background: rgba(4,12,25,.92) !important;
  color: #eaf6ff !important;
  border: 1px solid rgba(125,170,255,.36) !important;
  border-radius: 14px !important;
  padding: 8px !important;
  max-width: 100% !important;
}
body.ui-2028 input[type="file"]::file-selector-button {
  margin-right: 10px !important;
  border-radius: 12px !important;
  padding: 9px 14px !important;
  font-weight: 900 !important;
}
body.ui-2028 .audit-processing,
body.ui-2028 .audit-progress,
body.ui-2028 .audit-steps { background: rgba(5,14,27,.82) !important; color: var(--text-2028) !important; border-color: rgba(120,166,255,.28) !important; }

/* Correction Report page / email preview. Keep the actual report readable in dark UI. */
body.ui-2028 .send-form,
body.ui-2028 .correction-report-preview,
body.ui-2028 .report-preview,
body.ui-2028 .email-preview,
body.ui-2028 .message-preview,
body.ui-2028 .preview-shell {
  background: linear-gradient(135deg, rgba(7,17,31,.96), rgba(10,25,47,.92)) !important;
  color: var(--text-2028) !important;
  border: 1px solid rgba(120,166,255,.30) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.26) !important;
}
body.ui-2028 .correction-report-preview *:not(.badge):not(.severity):not(.btn),
body.ui-2028 .report-preview *:not(.badge):not(.severity):not(.btn),
body.ui-2028 .email-preview *:not(.badge):not(.severity):not(.btn) { color: var(--text-2028) !important; }
body.ui-2028 .preview-header,
body.ui-2028 .report-header,
body.ui-2028 .correction-report-title {
  background: linear-gradient(135deg, rgba(20,78,150,.92), rgba(82,55,190,.88)) !important;
  color: #fff !important;
  border-color: rgba(190,230,255,.30) !important;
}
body.ui-2028 .issue-preview-card,
body.ui-2028 .preview-issue,
body.ui-2028 .report-issue,
body.ui-2028 .included-issue,
body.ui-2028 .correction-report-preview .issue-card,
body.ui-2028 .correction-report-preview .preview-card {
  background: rgba(7,17,31,.86) !important;
  color: var(--text-2028) !important;
  border: 1px solid rgba(120,166,255,.26) !important;
}
body.ui-2028 .problem-box,
body.ui-2028 .evidence-box,
body.ui-2028 .action-box,
body.ui-2028 .preview-section,
body.ui-2028 .packet-attach-note,
body.ui-2028 .recipient-box,
body.ui-2028 .ai-note,
body.ui-2028 .preview-footer-note {
  background: rgba(8,20,38,.88) !important;
  color: var(--text-2028) !important;
  border-color: rgba(120,166,255,.28) !important;
}
body.ui-2028 .problem-box { border-left: 4px solid #fb7185 !important; }
body.ui-2028 .evidence-box { border-left: 4px solid #38bdf8 !important; }
body.ui-2028 .action-box { border-left: 4px solid #34d399 !important; }
body.ui-2028 .message-box,
body.ui-2028 textarea.message-box {
  min-height: 180px !important;
  background: rgba(3,10,20,.94) !important;
  color: #f4fbff !important;
}
body.ui-2028 .correction-send-progress {
  background: rgba(14,165,255,.12) !important;
  border-color: rgba(35,230,255,.38) !important;
  color: var(--text-2028) !important;
}
body.ui-2028 .correction-send-progress .progress-copy,
body.ui-2028 .correction-send-progress .progress-copy span { color: var(--text-2028) !important; }

/* Help/support/action chips that were still white-on-white in some panels */
body.ui-2028 .help-chip,
body.ui-2028 .chip,
body.ui-2028 .pill,
body.ui-2028 .badge:not(.danger):not(.warning):not(.success):not(.info),
body.ui-2028 .status-pill,
body.ui-2028 .tag {
  background: rgba(14,165,255,.14) !important;
  color: #dff8ff !important;
  border: 1px solid rgba(35,230,255,.28) !important;
}
body.ui-2028 .badge.warning,
body.ui-2028 .warning { color: #78350f !important; }
body.ui-2028 .badge.danger,
body.ui-2028 .danger { color: #fff !important; }
body.ui-2028 .badge.success,
body.ui-2028 .success { color: #052e16 !important; }

/* Internal Chat: stronger dark panels if older white cards remain. */
body.ui-2028 .chat-shell,
body.ui-2028 .chat-sidebar,
body.ui-2028 .chat-main,
body.ui-2028 .chat-tools,
body.ui-2028 .chat-compose,
body.ui-2028 .chat-drop,
body.ui-2028 .chat-message,
body.ui-2028 .chat-card {
  background: linear-gradient(135deg, rgba(7,17,31,.94), rgba(10,25,47,.88)) !important;
  color: var(--text-2028) !important;
  border-color: rgba(120,166,255,.28) !important;
}
body.ui-2028 .chat-message.mine { background: linear-gradient(135deg, rgba(14,165,255,.20), rgba(124,77,255,.16)) !important; }
body.ui-2028 .chat-message.deleted,
body.ui-2028 .chat-message.cleared { background: rgba(251,113,133,.14) !important; border-color: rgba(251,113,133,.38) !important; }

/* Keep native white browser file bars from visually dominating on dark screens. */
body.ui-2028 .audit-zone .file-list:empty::before,
body.ui-2028 .upload-zone .file-list:empty::before { content: "No files selected yet."; color: #a9bcda; }

/* ------------------------------------------------------------------
   Stage 6.6.23 - Final 2028 style sweep + Customize Layout removed
   Data-safe CSS only. Purpose: remove remaining white/unreadable islands
   across tabs while keeping important warning/success colors readable.
------------------------------------------------------------------- */
body.ui-2028 .customize-dashboard-btn,
body.ui-2028 .drag-handle,
body.ui-2028 .dashboard-drag-placeholder { display: none !important; }
body.ui-2028 [data-dash-widget] { cursor: default !important; }

/* Global dark panels for old pages/subpages that still use legacy classes. */
body.ui-2028 .card,
body.ui-2028 .panel,
body.ui-2028 .box,
body.ui-2028 .section,
body.ui-2028 .content-card,
body.ui-2028 .form-card,
body.ui-2028 .settings-card,
body.ui-2028 .admin-card,
body.ui-2028 .support-card,
body.ui-2028 .help-card,
body.ui-2028 .guide-card,
body.ui-2028 .audit-card,
body.ui-2028 .case-card,
body.ui-2028 .preview-card,
body.ui-2028 .issue-card,
body.ui-2028 .person-card,
body.ui-2028 .person-card-actions,
body.ui-2028 .message-card,
body.ui-2028 .upload-card,
body.ui-2028 .drop-card,
body.ui-2028 .table-wrap,
body.ui-2028 .modal-content,
body.ui-2028 .dialog,
body.ui-2028 .toast,
body.ui-2028 .empty,
body.ui-2028 .flash,
body.ui-2028 .nav-card,
body.ui-2028 .result-card,
body.ui-2028 .summary-card,
body.ui-2028 .crm-card,
body.ui-2028 .crm-panel,
body.ui-2028 .queue-card,
body.ui-2028 .field-card,
body.ui-2028 .review-card,
body.ui-2028 .history-card,
body.ui-2028 .evidence-card,
body.ui-2028 .ai-review-panel,
body.ui-2028 .help-article,
body.ui-2028 .support-request,
body.ui-2028 .address-card,
body.ui-2028 .company-card,
body.ui-2028 .retention-card,
body.ui-2028 .intake-card,
body.ui-2028 .doctor-card,
body.ui-2028 .school-card,
body.ui-2028 .chat-panel {
  background: linear-gradient(145deg, rgba(6,16,31,.96), rgba(10,27,51,.90)) !important;
  color: #eaf4ff !important;
  border-color: rgba(110, 166, 255, .26) !important;
  box-shadow: 0 18px 52px rgba(0,0,0,.22) !important;
}

/* Any legacy white blocks inside dark pages. */
body.ui-2028 .white-card,
body.ui-2028 .light-card,
body.ui-2028 .light-panel,
body.ui-2028 .bg-white,
body.ui-2028 .bg-light,
body.ui-2028 .well,
body.ui-2028 .callout,
body.ui-2028 .file-row,
body.ui-2028 .file-pill,
body.ui-2028 .file-status,
body.ui-2028 .file-selected,
body.ui-2028 .selected-file,
body.ui-2028 .file-list-row,
body.ui-2028 .upload-summary,
body.ui-2028 .preview-summary,
body.ui-2028 .report-body,
body.ui-2028 .report-section,
body.ui-2028 .issue-detail,
body.ui-2028 .issue-meta,
body.ui-2028 .status-form,
body.ui-2028 .status-box,
body.ui-2028 .inline-form,
body.ui-2028 .form-row,
body.ui-2028 .field-box,
body.ui-2028 .field-source,
body.ui-2028 .review-field,
body.ui-2028 .category-chip,
body.ui-2028 .article-chip {
  background: rgba(4, 13, 27, .94) !important;
  color: #eaf4ff !important;
  border-color: rgba(122, 174, 255, .30) !important;
}

/* Inputs/selects/textareas/buttons: readable and consistent on all tabs. */
body.ui-2028 input,
body.ui-2028 select,
body.ui-2028 textarea,
body.ui-2028 .input,
body.ui-2028 .select,
body.ui-2028 .textarea {
  background-color: rgba(3, 10, 22, .96) !important;
  color: #f5fbff !important;
  border: 1px solid rgba(125, 170, 255, .42) !important;
  border-radius: 14px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025) !important;
  caret-color: #67e8f9 !important;
}
body.ui-2028 input::placeholder,
body.ui-2028 textarea::placeholder { color: #94a9c7 !important; opacity: 1 !important; }
body.ui-2028 select option { background: #071426 !important; color: #f5fbff !important; }
body.ui-2028 input[type="checkbox"],
body.ui-2028 input[type="radio"] { accent-color: #22d3ee !important; width: auto !important; height: auto !important; }
body.ui-2028 input[type="file"] {
  background: #061324 !important;
  color: #eef8ff !important;
  border: 1px solid rgba(126,178,255,.44) !important;
  border-radius: 14px !important;
  padding: 9px !important;
}
body.ui-2028 input[type="file"]::file-selector-button,
body.ui-2028 input[type="file"]::-webkit-file-upload-button {
  background: linear-gradient(135deg, #0ea5ff, #7c3cff) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 12px !important;
  padding: 9px 14px !important;
  font-weight: 950 !important;
  cursor: pointer !important;
}
body.ui-2028 .btn,
body.ui-2028 button,
body.ui-2028 input[type="submit"],
body.ui-2028 input[type="button"] {
  background: linear-gradient(135deg, rgba(14,165,255,.95), rgba(124,58,237,.95)) !important;
  color: #fff !important;
  border: 1px solid rgba(190,230,255,.26) !important;
  border-radius: 14px !important;
  font-weight: 950 !important;
  box-shadow: 0 12px 26px rgba(14, 99, 255, .22) !important;
}
body.ui-2028 .btn:hover,
body.ui-2028 button:hover,
body.ui-2028 input[type="submit"]:hover { filter: brightness(1.08) !important; transform: translateY(-1px); }
body.ui-2028 .btn.danger,
body.ui-2028 button.danger,
body.ui-2028 .danger.btn { background: linear-gradient(135deg,#ef4444,#be123c) !important; color:#fff !important; }
body.ui-2028 .btn.secondary,
body.ui-2028 .btn.ghost { background: rgba(10,25,47,.88) !important; color:#dff7ff !important; }

/* Tables on every page. */
body.ui-2028 table,
body.ui-2028 .data-table,
body.ui-2028 .legacy-table {
  background: rgba(4, 13, 27, .92) !important;
  color: #eaf4ff !important;
  border-color: rgba(120,166,255,.25) !important;
}
body.ui-2028 thead,
body.ui-2028 th {
  background: rgba(10, 27, 51, .96) !important;
  color: #cfe8ff !important;
  border-color: rgba(120,166,255,.25) !important;
}
body.ui-2028 tbody,
body.ui-2028 tr,
body.ui-2028 td {
  background-color: rgba(4, 13, 27, .72) !important;
  color: #eaf4ff !important;
  border-color: rgba(120,166,255,.16) !important;
}
body.ui-2028 tr:hover td { background-color: rgba(14, 165, 255, .10) !important; }
body.ui-2028 code,
body.ui-2028 pre { background: rgba(2,8,18,.92) !important; color:#bff7ff !important; border-color:rgba(120,166,255,.24) !important; }

/* Drop zones/file bars: remove the last bright white strips seen on AUDIT and INTAKE. */
body.ui-2028 .upload-zone,
body.ui-2028 .audit-zone,
body.ui-2028 .intake-drop,
body.ui-2028 .dropzone,
body.ui-2028 .drop-zone,
body.ui-2028 .zip-dropzone,
body.ui-2028 .chat-drop,
body.ui-2028 [class*="drop"],
body.ui-2028 [class*="upload"] [class*="zone"] {
  background: radial-gradient(circle at top, rgba(20,184,255,.14), rgba(5,14,27,.92) 52%, rgba(2,8,18,.96)) !important;
  color: #eaf4ff !important;
  border: 1.5px dashed rgba(35,230,255,.50) !important;
}
body.ui-2028 .upload-zone *,
body.ui-2028 .audit-zone *,
body.ui-2028 .intake-drop *,
body.ui-2028 .dropzone *,
body.ui-2028 .drop-zone *,
body.ui-2028 .zip-dropzone * { color: #eaf4ff !important; }
body.ui-2028 .drop-hint,
body.ui-2028 .file-list,
body.ui-2028 .selected-files,
body.ui-2028 .selected-file-list,
body.ui-2028 .no-files,
body.ui-2028 .file-name,
body.ui-2028 .file-output,
body.ui-2028 .file-summary,
body.ui-2028 [id*="file"],
body.ui-2028 [id*="File"] {
  background: rgba(3, 10, 22, .96) !important;
  color: #dbeafe !important;
  border-color: rgba(126,178,255,.36) !important;
}

/* Keep meaningful alerts readable, not washed out. */
body.ui-2028 .alert,
body.ui-2028 .notice,
body.ui-2028 .warning-box,
body.ui-2028 .error-box,
body.ui-2028 .success-box,
body.ui-2028 .info-box { color: #f8fbff !important; border-radius: 16px !important; }
body.ui-2028 .alert.warning,
body.ui-2028 .warning-box,
body.ui-2028 .ai-note { background: rgba(245, 158, 11, .16) !important; border-color: rgba(245,158,11,.45) !important; color: #fff7ed !important; }
body.ui-2028 .alert.error,
body.ui-2028 .error-box,
body.ui-2028 .problem-box { background: rgba(239, 68, 68, .14) !important; border-color: rgba(248,113,113,.45) !important; color: #fff1f2 !important; }
body.ui-2028 .alert.success,
body.ui-2028 .success-box,
body.ui-2028 .action-box { background: rgba(34,197,94,.14) !important; border-color: rgba(74,222,128,.45) !important; color: #ecfdf5 !important; }
body.ui-2028 .alert.info,
body.ui-2028 .info-box,
body.ui-2028 .evidence-box { background: rgba(14,165,255,.14) !important; border-color: rgba(56,189,248,.45) !important; color: #eff6ff !important; }
body.ui-2028 .problem-box *,
body.ui-2028 .evidence-box *,
body.ui-2028 .action-box *,
body.ui-2028 .ai-note * { color: inherit !important; }

/* Badges: readable on dark backgrounds without turning into white pills. */
body.ui-2028 .badge,
body.ui-2028 .pill,
body.ui-2028 .tag,
body.ui-2028 .chip,
body.ui-2028 .status-pill,
body.ui-2028 .help-chip {
  background: rgba(14,165,255,.16) !important;
  color: #dff7ff !important;
  border-color: rgba(35,230,255,.32) !important;
}
body.ui-2028 .badge.warning,
body.ui-2028 .severity-warning { background: rgba(245,158,11,.18) !important; color: #fde68a !important; border-color: rgba(245,158,11,.44) !important; }
body.ui-2028 .badge.error,
body.ui-2028 .severity-error { background: rgba(239,68,68,.18) !important; color: #fecdd3 !important; border-color: rgba(248,113,113,.44) !important; }
body.ui-2028 .badge.complete,
body.ui-2028 .badge.success,
body.ui-2028 .severity-success { background: rgba(34,197,94,.16) !important; color: #bbf7d0 !important; border-color: rgba(74,222,128,.42) !important; }
body.ui-2028 .badge.sent { background: rgba(99,102,241,.18) !important; color: #ddd6fe !important; border-color: rgba(129,140,248,.42) !important; }

/* Correction report: user-facing email preview should still be readable but no white blocks. */
body.ui-2028 .correction-report-preview,
body.ui-2028 .report-preview,
body.ui-2028 .email-preview,
body.ui-2028 .preview-shell,
body.ui-2028 .message-preview {
  background: #061324 !important;
  color: #eaf4ff !important;
}
body.ui-2028 .correction-report-preview .report-block,
body.ui-2028 .correction-report-preview .meta-grid,
body.ui-2028 .correction-report-preview .issue-card,
body.ui-2028 .correction-report-preview .issue-preview-card,
body.ui-2028 .correction-report-preview .problem,
body.ui-2028 .correction-report-preview .evidence,
body.ui-2028 .correction-report-preview .action {
  background: rgba(7,17,31,.92) !important;
  color: #eaf4ff !important;
  border-color: rgba(120,166,255,.30) !important;
}

/* Help/support most-used guide cards after 2028 redesign. */
body.ui-2028 .help-card h1,
body.ui-2028 .help-card h2,
body.ui-2028 .help-card h3,
body.ui-2028 .support-card h1,
body.ui-2028 .support-card h2,
body.ui-2028 .support-card h3,
body.ui-2028 .guide-card h1,
body.ui-2028 .guide-card h2,
body.ui-2028 .guide-card h3 { color:#f8fbff !important; }
body.ui-2028 .help-card p,
body.ui-2028 .support-card p,
body.ui-2028 .guide-card p { color:#c7d7ef !important; }

/* Safety: never hide page content under transparent text. */
body.ui-2028 main,
body.ui-2028 main * { text-shadow: none; }
body.ui-2028 a:not(.btn):not(.side-link):not(.kpi-card-2028) { color: #8bdcff; }

/* ------------------------------------------------------------------
   Stage 6.6.24 - Remaining dark UI readability sweep
   Focus: Rules Manager, System/Maintenance, PDF viewer correction panel,
   Send Correction Report plain-text section, and dashboard click hover.
   Data-safe CSS only.
------------------------------------------------------------------- */
body.ui-2028 {
  --aba24-bg: rgba(5, 14, 28, .96);
  --aba24-card: linear-gradient(145deg, rgba(8, 20, 39, .98), rgba(12, 30, 56, .92));
  --aba24-card-soft: linear-gradient(145deg, rgba(11, 26, 49, .94), rgba(7, 18, 35, .94));
  --aba24-border: rgba(110, 175, 255, .33);
  --aba24-text: #eef8ff;
  --aba24-muted: #adc1e3;
  --aba24-cyan: #67e8f9;
}

/* Dashboard cards should feel clickable now that Customize Layout is removed. */
body.ui-2028 a.kpi-card-2028,
body.ui-2028 .quick-tile,
body.ui-2028 .command-actions-2028 a,
body.ui-2028 .weather-panel-2028 a,
body.ui-2028 .workflow-donut-card a,
body.ui-2028 .document-mix-card a,
body.ui-2028 a[data-dash-widget] {
  cursor: pointer !important;
}
body.ui-2028 a.kpi-card-2028:hover,
body.ui-2028 .quick-tile:hover,
body.ui-2028 .command-actions-2028 a:hover,
body.ui-2028 .workflow-donut-card:hover,
body.ui-2028 .document-mix-card:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(103,232,249,.72) !important;
  box-shadow: 0 22px 64px rgba(14,165,255,.20), 0 0 0 1px rgba(103,232,249,.20) !important;
}
body.ui-2028 [data-dash-widget] { cursor: auto !important; }
body.ui-2028 a[data-dash-widget] { cursor: pointer !important; }

/* Rules Manager: built-in guide boxes and visual signature boxes were still white. */
body.ui-2028 .rules-v2-form .rule-section,
body.ui-2028 .rules-v2-form .pro-rule-section,
body.ui-2028 .rules-v2-form .quality-card,
body.ui-2028 .rules-v2-form .document-policy-card,
body.ui-2028 .rules-v2-form .guide-section,
body.ui-2028 .rules-v2-form .guide-grid > div,
body.ui-2028 .rules-v2-form .rule-summary-box,
body.ui-2028 .rules-v2-form .rule-table-wrap,
body.ui-2028 .rules-v2-form .add-rule-grid > label,
body.ui-2028 .rules-v2-form .toggle-card,
body.ui-2028 .rules-v2-form .checkline,
body.ui-2028 .rules-v2-form .severity-select,
body.ui-2028 .rules-v2-form .sticky-rule-actions,
body.ui-2028 .guide-grid > div,
body.ui-2028 .quality-card,
body.ui-2028 .document-policy-card,
body.ui-2028 .rule-summary-box,
body.ui-2028 .rule-table-wrap,
body.ui-2028 .sticky-rule-actions {
  background: var(--aba24-card) !important;
  color: var(--aba24-text) !important;
  border: 1px solid var(--aba24-border) !important;
  border-radius: 20px !important;
  box-shadow: 0 18px 52px rgba(0,0,0,.24) !important;
}
body.ui-2028 .rules-v2-form .guide-grid > div *,
body.ui-2028 .rules-v2-form .quality-card *,
body.ui-2028 .rules-v2-form .document-policy-card *,
body.ui-2028 .rules-v2-form .rule-summary-box *,
body.ui-2028 .rules-v2-form .rule-table-wrap *,
body.ui-2028 .guide-grid > div *,
body.ui-2028 .quality-card *,
body.ui-2028 .document-policy-card * {
  color: inherit !important;
}
body.ui-2028 .rules-v2-form .guide-grid li,
body.ui-2028 .rules-v2-form .guide-grid em,
body.ui-2028 .rules-v2-form .quality-card p,
body.ui-2028 .rules-v2-form .document-policy-card p,
body.ui-2028 .rules-v2-form .rule-section p,
body.ui-2028 .rules-v2-form .rule-section span,
body.ui-2028 .rules-v2-form .rule-section em {
  color: var(--aba24-muted) !important;
}
body.ui-2028 .rules-v2-form h2,
body.ui-2028 .rules-v2-form h3,
body.ui-2028 .rules-v2-form strong,
body.ui-2028 .rules-v2-form label span:first-child {
  color: #f8fcff !important;
}
body.ui-2028 .rules-v2-form .checkline input,
body.ui-2028 .rules-v2-form input[type='checkbox'] { box-shadow: none !important; }
body.ui-2028 .rules-v2-form .sticky-rule-actions {
  position: sticky;
  bottom: 0;
  z-index: 8;
  padding: 16px !important;
  backdrop-filter: blur(12px);
}

/* System / Maintenance: rollback, backup, restore, paths and manifest blocks. */
body.ui-2028 .system-card,
body.ui-2028 .update-card,
body.ui-2028 .rollback-card,
body.ui-2028 .security-guard-card,
body.ui-2028 .restore-preview-card,
body.ui-2028 .system-paths-card,
body.ui-2028 .update-manifest-box,
body.ui-2028 .update-safety-box,
body.ui-2028 .mini-list-card,
body.ui-2028 .restore-preview-grid > div,
body.ui-2028 .restore-contents-grid > div,
body.ui-2028 .restore-option,
body.ui-2028 .restore-confirm-check,
body.ui-2028 .file-input-card,
body.ui-2028 .system-paths-card .kv-list div,
body.ui-2028 .polished-form label,
body.ui-2028 .local-backup-card,
body.ui-2028 .restore-backup-card {
  background: var(--aba24-card) !important;
  color: var(--aba24-text) !important;
  border-color: var(--aba24-border) !important;
  box-shadow: 0 18px 52px rgba(0,0,0,.24) !important;
}
body.ui-2028 .system-card *,
body.ui-2028 .update-card *,
body.ui-2028 .rollback-card *,
body.ui-2028 .restore-preview-card *,
body.ui-2028 .system-paths-card *,
body.ui-2028 .update-manifest-box *,
body.ui-2028 .update-safety-box *,
body.ui-2028 .file-input-card * { color: inherit !important; }
body.ui-2028 .restore-warning,
body.ui-2028 .restore-confirm-check {
  background: rgba(239,68,68,.13) !important;
  border-color: rgba(248,113,113,.45) !important;
  color: #ffd7dc !important;
}
body.ui-2028 .restore-chip.ok { background: rgba(34,197,94,.14) !important; color: #bbf7d0 !important; border-color: rgba(74,222,128,.42) !important; }
body.ui-2028 .restore-chip.warn { background: rgba(245,158,11,.14) !important; color: #fde68a !important; border-color: rgba(245,158,11,.42) !important; }
body.ui-2028 .restore-chip.bad { background: rgba(239,68,68,.14) !important; color: #fecdd3 !important; border-color: rgba(248,113,113,.42) !important; }

/* PDF Location Viewer: correction report strip and AI side panel. Keep the PDF page itself white/normal. */
body.ui-2028 .viewer-ai-layout,
body.ui-2028 .pdf-viewer-wrap,
body.ui-2028 .pdf-viewer-panel,
body.ui-2028 .ai-side-panel,
body.ui-2028 .ai-panel-head,
body.ui-2028 .ai-disclaimer-box,
body.ui-2028 .ai-score-card,
body.ui-2028 .ai-block,
body.ui-2028 .muted-block,
body.ui-2028 .manual-review-card,
body.ui-2028 .correction-report-card,
body.ui-2028 .evidence-correction-card,
body.ui-2028 .viewer-correction-card,
body.ui-2028 .send-correction-panel,
body.ui-2028 .send-report-panel,
body.ui-2028 .viewer-send-report,
body.ui-2028 [class*='correction'][class*='panel'],
body.ui-2028 [class*='correction'][class*='card'],
body.ui-2028 [class*='send'][class*='report'] {
  background: var(--aba24-card-soft) !important;
  color: var(--aba24-text) !important;
  border: 1px solid var(--aba24-border) !important;
  border-radius: 20px !important;
  box-shadow: 0 18px 52px rgba(0,0,0,.24) !important;
}
body.ui-2028 .viewer-ai-layout *,
body.ui-2028 .ai-side-panel *,
body.ui-2028 .manual-review-card *,
body.ui-2028 [class*='correction'][class*='panel'] *,
body.ui-2028 [class*='correction'][class*='card'] * { color: inherit !important; }
body.ui-2028 .pdf-page,
body.ui-2028 .pdf-page *,
body.ui-2028 .pdf-page img {
  background: #fff !important;
  color: #111827 !important;
}
body.ui-2028 .issue-banner.warning { background: rgba(245,158,11,.18) !important; color: #ffefbf !important; border-color: rgba(245,158,11,.45) !important; }
body.ui-2028 .issue-banner.error { background: rgba(239,68,68,.16) !important; color: #ffd2d9 !important; border-color: rgba(248,113,113,.45) !important; }

/* Send Correction Report: plain-text area and lower button strip. */
body.ui-2028 .plain-text-details,
body.ui-2028 .plain-text-details summary,
body.ui-2028 .plain-text-details .message-box,
body.ui-2028 textarea.message-box,
body.ui-2028 .send-report-actions,
body.ui-2028 .correction-actions,
body.ui-2028 .send-footer-actions,
body.ui-2028 .after-send-actions,
body.ui-2028 .included-open-issues,
body.ui-2028 .included-open-issues .table-wrap {
  background: var(--aba24-bg) !important;
  color: var(--aba24-text) !important;
  border-color: var(--aba24-border) !important;
}
body.ui-2028 .plain-text-details summary {
  cursor: pointer !important;
  padding: 12px 14px !important;
  border-radius: 14px !important;
  font-weight: 950 !important;
}
body.ui-2028 textarea.message-box,
body.ui-2028 .plain-text-details textarea {
  min-height: 220px !important;
  resize: vertical !important;
  line-height: 1.45 !important;
  font-size: 14px !important;
}
body.ui-2028 .preview-block.problem,
body.ui-2028 .problem-box { background: rgba(239,68,68,.12) !important; color: #ffd2d9 !important; border-color: rgba(248,113,113,.45) !important; }
body.ui-2028 .preview-block.evidence,
body.ui-2028 .evidence-box { background: rgba(59,130,246,.12) !important; color: #dbeafe !important; border-color: rgba(96,165,250,.45) !important; }
body.ui-2028 .preview-block.action,
body.ui-2028 .action-box { background: rgba(34,197,94,.12) !important; color: #d1fae5 !important; border-color: rgba(74,222,128,.45) !important; }
body.ui-2028 .preview-ai-note { background: rgba(245,158,11,.14) !important; color: #fde68a !important; border-color: rgba(245,158,11,.45) !important; }

/* Last-resort white island rescue, but do not touch actual PDF image/canvas pages. */
body.ui-2028 main :is(div,section,article,aside,details,summary,form,fieldset,label)[style*='background: #fff'],
body.ui-2028 main :is(div,section,article,aside,details,summary,form,fieldset,label)[style*='background:#fff'],
body.ui-2028 main :is(div,section,article,aside,details,summary,form,fieldset,label)[style*='background: white'],
body.ui-2028 main :is(div,section,article,aside,details,summary,form,fieldset,label)[style*='background:white'],
body.ui-2028 main :is(div,section,article,aside,details,summary,form,fieldset,label)[style*='background-color: #fff'],
body.ui-2028 main :is(div,section,article,aside,details,summary,form,fieldset,label)[style*='background-color:#fff'],
body.ui-2028 main :is(div,section,article,aside,details,summary,form,fieldset,label)[style*='background-color: white'],
body.ui-2028 main :is(div,section,article,aside,details,summary,form,fieldset,label)[style*='background-color:white'] {
  background: var(--aba24-card) !important;
  color: var(--aba24-text) !important;
  border-color: var(--aba24-border) !important;
}
body.ui-2028 main :is(div,section,article,aside,details,summary,form,fieldset,label)[style*='background'] * { color: inherit; }
body.ui-2028 .pdf-page[style*='background'] *,
body.ui-2028 .pdf-page * { color: #111827 !important; }

/* ------------------------------------------------------------------
   Stage 6.6.25 - Final PDF Viewer + Rules Manager Contrast Rescue
   UI-only/data-safe. Fixes red evidence highlight visibility, remaining
   white viewer/report strips, Rules Manager guide cards, and dashboard
   hand cursor on command-center cards.
------------------------------------------------------------------- */
body.ui-2028 {
  --aba25-panel: linear-gradient(145deg, rgba(7,18,35,.98), rgba(13,32,60,.94));
  --aba25-panel-2: linear-gradient(145deg, rgba(10,24,46,.98), rgba(5,14,29,.98));
  --aba25-border: rgba(105, 185, 255, .36);
  --aba25-text: #f4fbff;
  --aba25-muted: #b9cdec;
  --aba25-input: #050d1a;
}

/* Dashboard: after Customize Layout was removed, every dashboard square should feel clickable. */
body.ui-2028 .dashboard-2028 a,
body.ui-2028 .dashboard-shell-2028 a,
body.ui-2028 .dashboard-command-card,
body.ui-2028 .command-center-card,
body.ui-2028 .command-card,
body.ui-2028 .weather-panel-2028,
body.ui-2028 .kpi-card-2028,
body.ui-2028 .workflow-donut-card,
body.ui-2028 .document-mix-card,
body.ui-2028 .quick-access-2028 a,
body.ui-2028 .quick-access-grid a,
body.ui-2028 .quick-tile,
body.ui-2028 .command-actions-2028 a,
body.ui-2028 .command-hero-2028 a,
body.ui-2028 .metric-card,
body.ui-2028 .summary-card.click-card,
body.ui-2028 .click-card,
body.ui-2028 [onclick],
body.ui-2028 .doc-mix-row {
  cursor: pointer !important;
}
body.ui-2028 .kpi-card-2028:hover,
body.ui-2028 .metric-card:hover,
body.ui-2028 .summary-card.click-card:hover,
body.ui-2028 .quick-tile:hover,
body.ui-2028 .doc-mix-row:hover,
body.ui-2028 .workflow-donut-card:hover,
body.ui-2028 .document-mix-card:hover {
  border-color: rgba(103,232,249,.78) !important;
  box-shadow: 0 22px 60px rgba(14,165,255,.20), 0 0 0 1px rgba(103,232,249,.24) !important;
  transform: translateY(-2px) !important;
}

/* PDF viewer: preserve the actual PDF page as white, but never cover the evidence highlight. */
body.ui-2028 .pdf-viewer-wrap,
body.ui-2028 .pdf-viewer-panel {
  background: rgba(3,10,22,.98) !important;
  border: 1px solid rgba(103,232,249,.30) !important;
  border-radius: 18px !important;
  padding: 14px !important;
  overflow: auto !important;
}
body.ui-2028 .pdf-page {
  position: relative !important;
  background: #ffffff !important;
  color: #111827 !important;
  isolation: isolate !important;
  overflow: visible !important;
}
body.ui-2028 .pdf-page img {
  display: block !important;
  background: #ffffff !important;
  color: #111827 !important;
  position: relative !important;
  z-index: 1 !important;
}
body.ui-2028 .pdf-page :not(.highlight-box) {
  color: #111827 !important;
}
body.ui-2028 .pdf-page .highlight-box,
body.ui-2028 .pdf-page div.highlight-box,
body.ui-2028 div.highlight-box {
  position: absolute !important;
  z-index: 20 !important;
  box-sizing: border-box !important;
  pointer-events: none !important;
  background: rgba(255, 36, 36, .16) !important;
  border: 4px solid #ff2d2d !important;
  outline: 2px solid rgba(255,255,255,.78) !important;
  box-shadow: 0 0 0 1px rgba(127,29,29,.70), 0 0 22px rgba(239,68,68,.45) !important;
  border-radius: 4px !important;
  mix-blend-mode: normal !important;
}
body.ui-2028 .pdf-page .highlight-box::before {
  content: "";
  position: absolute;
  inset: -2px;
  border: 1px dashed rgba(127,29,29,.85);
  border-radius: 4px;
}

/* PDF viewer correction panels had local inline white styles from older templates. */
body.ui-2028 .viewer-communication-panel,
body.ui-2028 .viewer-send-sidecard,
body.ui-2028 .viewer-comm-actions,
body.ui-2028 .viewer-comm-meta,
body.ui-2028 .viewer-correction-card,
body.ui-2028 .viewer-send-report,
body.ui-2028 .evidence-correction-card,
body.ui-2028 .send-correction-panel,
body.ui-2028 .correction-report-card {
  background: var(--aba25-panel) !important;
  color: var(--aba25-text) !important;
  border: 1px solid var(--aba25-border) !important;
  border-radius: 18px !important;
  box-shadow: 0 18px 56px rgba(0,0,0,.34) !important;
}
body.ui-2028 .viewer-communication-panel *,
body.ui-2028 .viewer-send-sidecard *,
body.ui-2028 .viewer-correction-card *,
body.ui-2028 .viewer-send-report *,
body.ui-2028 .evidence-correction-card *,
body.ui-2028 .send-correction-panel *,
body.ui-2028 .correction-report-card * {
  color: inherit !important;
}
body.ui-2028 .viewer-communication-panel h2,
body.ui-2028 .viewer-send-sidecard h2,
body.ui-2028 .ai-side-panel h2,
body.ui-2028 .ai-side-panel h3 {
  color: #f8fcff !important;
}
body.ui-2028 .viewer-communication-panel p,
body.ui-2028 .viewer-send-sidecard p,
body.ui-2028 .ai-side-panel p,
body.ui-2028 .ai-side-panel .muted,
body.ui-2028 .ai-side-panel .note {
  color: var(--aba25-muted) !important;
}
body.ui-2028 .mini-pill {
  background: rgba(59,130,246,.18) !important;
  color: #dbeafe !important;
  border: 1px solid rgba(96,165,250,.45) !important;
}
body.ui-2028 .ai-side-panel,
body.ui-2028 .ai-panel-head,
body.ui-2028 .ai-block,
body.ui-2028 .muted-block,
body.ui-2028 .empty {
  background: var(--aba25-panel-2) !important;
  color: var(--aba25-text) !important;
  border-color: var(--aba25-border) !important;
}

/* Rules Manager: strongest override for remaining white guide/signature cards and the bottom action bar. */
html body.ui-2028 main .rules-v2-form .guide-section,
html body.ui-2028 main .rules-v2-form .guide-section .guide-grid,
html body.ui-2028 main .rules-v2-form .guide-section .guide-grid > div,
html body.ui-2028 main .rules-v2-form .guide-grid > div,
html body.ui-2028 main .rules-v2-form .quality-grid > div,
html body.ui-2028 main .rules-v2-form .quality-card,
html body.ui-2028 main .rules-v2-form .document-policy-card,
html body.ui-2028 main .rules-v2-form .rule-summary-box,
html body.ui-2028 main .rules-v2-form .rule-table-wrap,
html body.ui-2028 main .rules-v2-form .sticky-rule-actions,
html body.ui-2028 main .rules-v2-form .add-rule-grid,
html body.ui-2028 main .rules-v2-form .add-rule-grid > label {
  background: var(--aba25-panel) !important;
  background-color: rgba(7,18,35,.98) !important;
  color: var(--aba25-text) !important;
  border: 1px solid var(--aba25-border) !important;
  border-radius: 18px !important;
  box-shadow: 0 18px 56px rgba(0,0,0,.32) !important;
}
html body.ui-2028 main .rules-v2-form .guide-section *,
html body.ui-2028 main .rules-v2-form .guide-grid > div *,
html body.ui-2028 main .rules-v2-form .quality-card *,
html body.ui-2028 main .rules-v2-form .document-policy-card *,
html body.ui-2028 main .rules-v2-form .rule-summary-box *,
html body.ui-2028 main .rules-v2-form .sticky-rule-actions * {
  color: inherit !important;
}
html body.ui-2028 main .rules-v2-form .guide-section h2,
html body.ui-2028 main .rules-v2-form .guide-grid h3,
html body.ui-2028 main .rules-v2-form .quality-card h3,
html body.ui-2028 main .rules-v2-form .document-policy-card h3,
html body.ui-2028 main .rules-v2-form label > span:first-child,
html body.ui-2028 main .rules-v2-form strong {
  color: #f8fcff !important;
}
html body.ui-2028 main .rules-v2-form .guide-section p,
html body.ui-2028 main .rules-v2-form .guide-grid li,
html body.ui-2028 main .rules-v2-form .guide-grid em,
html body.ui-2028 main .rules-v2-form .quality-card p,
html body.ui-2028 main .rules-v2-form .document-policy-card p,
html body.ui-2028 main .rules-v2-form .muted {
  color: #c7d7ef !important;
}
html body.ui-2028 main .rules-v2-form input,
html body.ui-2028 main .rules-v2-form select,
html body.ui-2028 main .rules-v2-form textarea {
  background: var(--aba25-input) !important;
  color: #f8fcff !important;
  border: 1px solid rgba(125,190,255,.45) !important;
  box-shadow: inset 0 0 0 1px rgba(103,232,249,.08) !important;
}
html body.ui-2028 main .rules-v2-form input::placeholder,
html body.ui-2028 main .rules-v2-form textarea::placeholder { color: #8fa7ca !important; }
html body.ui-2028 main .rules-v2-form .sticky-rule-actions,
html body.ui-2028 main .rules-v2-form .actions-row,
html body.ui-2028 main .rules-v2-form [class*='actions'] {
  background: rgba(4,12,25,.98) !important;
  border-top: 1px solid rgba(103,232,249,.25) !important;
}

/* Form/action white strips across remaining legacy pages, with PDF page protected above. */
body.ui-2028 main :is(.actions-row,.form-actions,.button-row,.footer-actions,.action-strip,.toolbar,.controls-row):not(.pdf-page):not(.pdf-page *) {
  background: rgba(5,14,28,.96) !important;
  color: var(--aba25-text) !important;
  border-color: var(--aba25-border) !important;
}
body.ui-2028 main :is(.actions-row,.form-actions,.button-row,.footer-actions,.action-strip,.toolbar,.controls-row):not(.pdf-page):not(.pdf-page *) * {
  color: inherit !important;
}

/* Stage 6.6.26 Clients CRM / company pipeline board */
.clients-hero h1{font-size:clamp(2.2rem,5vw,4rem);}
.clients-command-card,.clients-add-card,.clients-detail-card{border-radius:24px;}
.clients-board-top{display:flex;gap:18px;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;}
.clients-filter-form{display:grid;grid-template-columns:minmax(180px,260px) minmax(240px,1fr) minmax(180px,240px) auto auto;gap:12px;align-items:end;flex:1;min-width:min(980px,100%);}
.clients-add-form{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:12px;align-items:end;}
.clients-add-form .clients-wide,.client-form-grid .clients-wide{grid-column:1/-1;}
.clients-board-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(520px,1fr));gap:18px;margin:18px 0;}
.clients-stage-card{background:rgba(11,24,45,.76);border:1px solid rgba(132,166,255,.22);border-radius:22px;box-shadow:0 22px 65px rgba(0,0,0,.24);overflow:hidden;}
.clients-stage-card header{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid rgba(132,166,255,.18);background:linear-gradient(135deg,rgba(17,37,70,.9),rgba(9,22,43,.72));}
.clients-stage-card header>div{display:flex;gap:10px;align-items:center;font-size:1.05rem;}
.stage-dot{width:12px;height:12px;border-radius:999px;background:#2fe6a6;box-shadow:0 0 14px rgba(47,230,166,.65);display:inline-block;}
.stage-awaiting-documents .stage-dot,.stage-paperwork-sent .stage-dot{background:#fb923c;box-shadow:0 0 14px rgba(251,146,60,.65);}
.stage-needs-follow-up .stage-dot{background:#ff4fd8;box-shadow:0 0 14px rgba(255,79,216,.65);}
.stage-authorization-pending .stage-dot,.stage-ready-for-insurance .stage-dot{background:#facc15;box-shadow:0 0 14px rgba(250,204,21,.65);}
.stage-approved-and-active .stage-dot{background:#22c55e;box-shadow:0 0 14px rgba(34,197,94,.65);}
.clients-stage-table-wrap{overflow:auto;max-height:460px;}
.clients-table{width:100%;border-collapse:separate;border-spacing:0;min-width:760px;}
.clients-table th{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:#9bbcff;background:rgba(6,14,28,.75);position:sticky;top:0;z-index:2;}
.clients-table td,.clients-table th{padding:12px;border-bottom:1px solid rgba(132,166,255,.13);vertical-align:top;}
.mini-doc{display:inline-block;margin:2px 4px 2px 0;padding:4px 7px;border-radius:999px;background:rgba(132,166,255,.1);border:1px solid rgba(132,166,255,.2);font-size:.72rem;color:#cfe2ff;}
.client-status{display:inline-flex;padding:6px 9px;border-radius:999px;font-size:.76rem;font-weight:900;background:rgba(132,166,255,.12);border:1px solid rgba(132,166,255,.2);color:#eaf4ff;}
.auth-approved{background:rgba(34,197,94,.18);border-color:rgba(34,197,94,.38);color:#b8ffd8;}.auth-pending{background:rgba(250,204,21,.16);border-color:rgba(250,204,21,.34);color:#fff0ad;}.auth-denied,.auth-expired{background:rgba(239,68,68,.18);border-color:rgba(239,68,68,.35);color:#ffc6c6;}
.clients-records-list{display:grid;gap:18px;}
.client-record-form{background:rgba(8,18,36,.72);border:1px solid rgba(132,166,255,.2);border-radius:22px;padding:18px;scroll-margin-top:92px;}
.client-record-head{display:flex;gap:14px;align-items:center;justify-content:space-between;margin-bottom:14px;}
.client-record-head h3{margin:0;font-size:1.35rem;}.client-record-actions{display:flex;gap:10px;flex-wrap:wrap;}
.client-form-grid{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:12px;}
.clients-bottom-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(320px,.7fr);gap:18px;margin-top:18px;}
.section-head-row{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;}.automation-list{display:grid;gap:10px;margin:12px 0 18px;}.automation-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px;border:1px solid rgba(132,166,255,.17);border-radius:16px;background:rgba(6,14,28,.42);}.automation-builder{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:12px;align-items:end;padding-top:16px;border-top:1px solid rgba(132,166,255,.18);}.activity-feed{display:grid;gap:10px;max-height:520px;overflow:auto;}.activity-item{padding:12px;border-radius:16px;background:rgba(6,14,28,.44);border:1px solid rgba(132,166,255,.17);}.activity-item span{display:block;color:#98aad0;font-size:.8rem;margin:3px 0 6px;}.activity-item code{display:block;white-space:pre-wrap;max-height:90px;overflow:auto;font-size:.75rem;}
.clients-live-banner{position:sticky;top:82px;z-index:6;margin-bottom:14px;}
body.ui-2028 .clients-stage-card input,body.ui-2028 .clients-stage-card textarea,body.ui-2028 .clients-stage-card select,body.ui-2028 .client-record-form input,body.ui-2028 .client-record-form textarea,body.ui-2028 .client-record-form select,body.ui-2028 .automation-builder input,body.ui-2028 .automation-builder select{background:rgba(5,12,24,.86)!important;color:#f4fbff!important;border:1px solid rgba(132,166,255,.28)!important;border-radius:12px;}
body.ui-2028 .clients-stage-card,body.ui-2028 .client-record-form{color:#f4fbff!important;}
body.ui-2028 .clients-stage-card *:not(.btn):not(.badge):not(input):not(select):not(textarea){color:inherit;}
body.ui-2028 .clients-table td{color:#e9f4ff;}
@media(max-width:1120px){.clients-filter-form,.clients-add-form,.client-form-grid,.automation-builder{grid-template-columns:1fr 1fr}.clients-board-grid,.clients-bottom-grid{grid-template-columns:1fr;}}
@media(max-width:720px){.clients-filter-form,.clients-add-form,.client-form-grid,.automation-builder{grid-template-columns:1fr}.client-record-head{align-items:flex-start;flex-direction:column}.clients-board-grid{grid-template-columns:1fr}.clients-table{min-width:680px}}

/* Stage 6.6.27 Clients CRM board + INTAKE dark polish */
.clients-board-shell{margin:18px 0;padding:18px;border:1px solid rgba(132,166,255,.22);border-radius:26px;background:linear-gradient(135deg,rgba(6,16,32,.92),rgba(11,26,49,.84));box-shadow:0 28px 80px rgba(0,0,0,.26);}
.clients-pipeline-meta{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px;color:#eef8ff}.clients-pipeline-meta div{display:grid;gap:3px}.clients-pipeline-meta span{font-size:.9rem;color:#9db5d6}.clients-add-form-compact{margin:0 0 16px;padding:14px;border:1px dashed rgba(125,181,255,.36);border-radius:18px;background:rgba(5,14,28,.66)}
.clients-kanban{display:flex;gap:14px;overflow-x:auto;padding:4px 2px 12px;scroll-snap-type:x proximity;min-height:460px}.clients-kanban::-webkit-scrollbar{height:10px}.clients-kanban::-webkit-scrollbar-track{background:rgba(6,14,28,.6);border-radius:999px}.clients-kanban::-webkit-scrollbar-thumb{background:linear-gradient(90deg,#1fb6ff,#7c3aed);border-radius:999px}.crm-column{min-width:310px;width:310px;scroll-snap-align:start;background:rgba(8,20,38,.88);border:1px solid rgba(132,166,255,.24);border-radius:22px;box-shadow:0 16px 45px rgba(0,0,0,.22);overflow:hidden}.crm-column>header{display:flex;justify-content:space-between;align-items:center;padding:14px 14px;border-bottom:1px solid rgba(132,166,255,.18);background:linear-gradient(135deg,rgba(18,41,78,.94),rgba(8,20,40,.74));color:#f4fbff}.crm-column>header>div{display:flex;align-items:center;gap:9px}.crm-count{min-width:30px;text-align:center;padding:4px 8px;border-radius:999px;background:rgba(31,182,255,.16);border:1px solid rgba(31,182,255,.35);color:#dff8ff;font-weight:900}.crm-dropzone{display:grid;gap:12px;align-content:start;min-height:360px;padding:12px}.crm-dropzone.drag-over{background:rgba(31,182,255,.12);outline:2px dashed rgba(31,182,255,.65);outline-offset:-8px}.crm-empty-drop{border:1px dashed rgba(132,166,255,.28);border-radius:16px;padding:22px;text-align:center;color:#83a0c7;background:rgba(2,8,18,.36)}.crm-client-card{display:grid;gap:8px;background:linear-gradient(145deg,rgba(11,28,55,.97),rgba(16,37,69,.9));border:1px solid rgba(132,166,255,.26);border-radius:18px;padding:12px;color:#f4fbff;cursor:grab;box-shadow:0 12px 34px rgba(0,0,0,.22);transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease}.crm-client-card:hover{transform:translateY(-2px);border-color:rgba(31,182,255,.58);box-shadow:0 18px 42px rgba(31,182,255,.09)}.crm-client-card.dragging{opacity:.55;transform:rotate(1deg) scale(.98)}.crm-card-top{display:flex;align-items:start;justify-content:space-between;gap:10px}.crm-card-top strong{font-size:1rem;color:#fff}.drag-pill{font-size:.68rem;text-transform:uppercase;letter-spacing:.08em;color:#9eeeff;background:rgba(31,182,255,.13);border:1px solid rgba(31,182,255,.32);border-radius:999px;padding:3px 8px}.crm-card-line{font-size:.82rem;color:#aecaef}.crm-chip-row{display:flex;gap:6px;flex-wrap:wrap;align-items:center}.crm-missing{background:rgba(251,191,36,.12);border:1px solid rgba(251,191,36,.28);color:#ffeab0;border-radius:12px;padding:7px 9px;font-size:.8rem}.crm-client-card .btn.tiny{justify-self:start;margin-top:2px}.client-record-form{scroll-margin-top:90px}.client-form-grid label span,.clients-add-form label span,.automation-builder label span,.clients-filter-form label span{color:#9edfff!important}.client-form-grid input,.client-form-grid select,.client-form-grid textarea,.clients-add-form input,.clients-add-form select,.clients-add-form textarea,.automation-builder input,.automation-builder select,.clients-filter-form input,.clients-filter-form select{background:#06101f!important;color:#f6fbff!important;border:1px solid rgba(125,181,255,.34)!important;border-radius:12px!important}.activity-item code{white-space:pre-wrap;word-break:break-word;color:#dbeafe;background:rgba(0,0,0,.22);border:1px solid rgba(132,166,255,.18);border-radius:10px;padding:8px;display:block;margin-top:6px}.automation-row{background:rgba(8,20,38,.72);border:1px solid rgba(132,166,255,.2);border-radius:16px;padding:12px;margin-bottom:10px;display:flex;align-items:center;justify-content:space-between;gap:12px}
body.ui-2028 .manual-review-warning{background:linear-gradient(135deg,rgba(251,191,36,.18),rgba(245,158,11,.08))!important;border-color:rgba(251,191,36,.55)!important;color:#fff7d6!important;box-shadow:0 18px 55px rgba(0,0,0,.22)!important}body.ui-2028 .manual-review-warning h2,body.ui-2028 .manual-review-warning p,body.ui-2028 .manual-review-warning strong{color:#fff7d6!important}body.ui-2028 .intake-field,body.ui-2028 .intake-extra-card{background:linear-gradient(145deg,rgba(8,21,42,.96),rgba(13,31,60,.88))!important;border:1px solid rgba(132,166,255,.25)!important;color:#eff8ff!important;box-shadow:inset 0 1px rgba(255,255,255,.04)!important}body.ui-2028 .intake-field span,body.ui-2028 .intake-extra-card dt{color:#8ee7ff!important}body.ui-2028 .intake-field input,body.ui-2028 .intake-field textarea,body.ui-2028 .intake-field select{background:#06101f!important;border:1px solid rgba(125,181,255,.34)!important;color:#f6fbff!important;border-radius:10px!important;padding:7px 9px!important}body.ui-2028 .intake-field small,body.ui-2028 .intake-extra-card .muted,body.ui-2028 .intake-extra-card small{color:#a7bddc!important}body.ui-2028 .intake-extra-card dd,body.ui-2028 .intake-extra-card li,body.ui-2028 .intake-extra-card p{color:#eaf6ff!important}body.ui-2028 .warn-note{background:linear-gradient(135deg,rgba(251,191,36,.18),rgba(245,158,11,.08))!important;border-color:rgba(251,191,36,.55)!important;color:#fff4c2!important}body.ui-2028 .selected-npi-box{background:rgba(34,197,94,.12)!important;border-color:rgba(34,197,94,.45)!important;color:#d9ffe7!important}.intake-actions-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:12px}body.ui-2028 .npi-kind{background:rgba(59,130,246,.2)!important;color:#cfe6ff!important;border:1px solid rgba(125,181,255,.34)!important}body.ui-2028 .npi-kind.recommended{background:rgba(251,191,36,.18)!important;color:#fff4c2!important}
@media(max-width:900px){.crm-column{min-width:280px;width:280px}.clients-kanban{min-height:420px}.clients-pipeline-meta{align-items:flex-start;flex-direction:column}}

/* Stage 6.6.28 Clients CRM cleanup: board-first layout, modal editor, admin-only activity records */
body.ui-2028 .clients-board-shell{padding:22px!important;border-radius:30px!important;background:linear-gradient(135deg,rgba(5,16,34,.96),rgba(7,25,48,.9))!important;border:1px solid rgba(83,157,255,.28)!important;box-shadow:0 30px 90px rgba(0,0,0,.32)!important;}
body.ui-2028 .clients-pipeline-meta{align-items:center!important;margin-bottom:18px!important;}
body.ui-2028 .clients-pipeline-meta strong{font-size:1.3rem!important;color:#f8fcff!important;}
body.ui-2028 .clients-kanban{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(310px,1fr))!important;gap:16px!important;overflow:visible!important;min-height:0!important;padding:0!important;scroll-snap-type:none!important;}
body.ui-2028 .crm-column{width:auto!important;min-width:0!important;min-height:260px!important;background:linear-gradient(145deg,rgba(8,21,41,.97),rgba(5,16,31,.94))!important;border:1px solid rgba(74,144,255,.28)!important;border-radius:24px!important;box-shadow:0 22px 65px rgba(0,0,0,.26)!important;}
body.ui-2028 .crm-column>header{padding:14px 16px!important;background:linear-gradient(135deg,rgba(26,55,101,.82),rgba(7,20,41,.95))!important;}
body.ui-2028 .crm-dropzone{min-height:190px!important;max-height:430px!important;overflow:auto!important;scrollbar-width:thin!important;}
body.ui-2028 .crm-client-card{cursor:grab!important;background:linear-gradient(145deg,rgba(13,34,65,.98),rgba(7,20,42,.96))!important;border:1px solid rgba(106,177,255,.32)!important;box-shadow:0 14px 42px rgba(0,0,0,.28)!important;}
body.ui-2028 .crm-client-card:active{cursor:grabbing!important;}
body.ui-2028 .crm-edit-btn{cursor:pointer!important;background:linear-gradient(135deg,#1fb6ff,#7c3aed)!important;color:#fff!important;border:0!important;box-shadow:0 12px 28px rgba(31,182,255,.18)!important;}
body.ui-2028 .drag-pill{color:#c7fbff!important;background:rgba(31,182,255,.15)!important;border-color:rgba(31,182,255,.38)!important;}
body.ui-2028 .clients-detail-card{display:none!important;}
body.ui-2028 .clients-automation-panel{margin-top:18px!important;}
body.ui-2028 .clients-automation-details{padding:0!important;overflow:hidden!important;}
body.ui-2028 .clients-automation-details>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;border-bottom:1px solid rgba(132,166,255,.16);background:linear-gradient(135deg,rgba(12,31,60,.92),rgba(6,18,37,.9));}
body.ui-2028 .clients-automation-details>summary::-webkit-details-marker{display:none;}
body.ui-2028 .clients-automation-details>summary span{font-size:1.2rem;font-weight:900;color:#f8fcff;}
body.ui-2028 .clients-automation-details>summary small{color:#9fb8da;font-weight:700;max-width:760px;text-align:right;}
body.ui-2028 .clients-automation-details .section-head-row,body.ui-2028 .clients-automation-details .automation-list,body.ui-2028 .clients-automation-details .automation-builder{padding-left:20px!important;padding-right:20px!important;}
body.ui-2028 .clients-automation-details .section-head-row{padding-top:18px!important;}
body.ui-2028 .clients-modal-overlay{position:fixed;inset:0;background:rgba(0,7,18,.76);backdrop-filter:blur(10px);z-index:9999;display:none;align-items:center;justify-content:center;padding:24px;}
body.ui-2028 .clients-modal-overlay.open{display:flex;}
body.ui-2028 .clients-modal{width:min(1120px,96vw);max-height:92vh;overflow:auto;background:linear-gradient(145deg,rgba(7,20,40,.98),rgba(12,31,59,.98));border:1px solid rgba(107,174,255,.38);border-radius:28px;box-shadow:0 35px 110px rgba(0,0,0,.55);padding:20px;}
body.ui-2028 .clients-modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:16px;padding-bottom:14px;border-bottom:1px solid rgba(132,166,255,.18);}
body.ui-2028 .clients-modal-head h2{margin:.35rem 0;color:#fff;font-size:1.7rem;}
body.ui-2028 .client-record-modal-form{display:block!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;}
body.ui-2028 .client-record-modal-form .client-record-head{background:rgba(10,26,52,.74)!important;border:1px solid rgba(132,166,255,.22)!important;border-radius:20px!important;padding:14px!important;margin-bottom:14px!important;}
body.ui-2028 .client-record-modal-form .client-form-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))!important;gap:12px!important;}
body.ui-2028 .client-record-modal-form label{background:rgba(4,13,27,.52)!important;border:1px solid rgba(132,166,255,.14)!important;border-radius:16px!important;padding:10px!important;}
body.ui-2028 .client-record-modal-form input,body.ui-2028 .client-record-modal-form select,body.ui-2028 .client-record-modal-form textarea{width:100%!important;}
body.ui-2028 .client-record-modal-form .clients-wide{grid-column:1/-1!important;}
body.ui-2028 .activity-feed,body.ui-2028 .activity-item{display:none!important;}
@media(max-width:900px){body.ui-2028 .clients-modal{width:98vw;padding:14px;}body.ui-2028 .clients-modal-head{flex-direction:column;}body.ui-2028 .clients-kanban{grid-template-columns:1fr!important;}}

/* Stage 6.6.29 - Clients CRM practical 4-lane rectangular board */
body.ui-2028 .clients-board-shell{
  padding:18px!important;
  border-radius:26px!important;
}
body.ui-2028 .clients-pipeline-meta{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin-bottom:14px!important;
}
body.ui-2028 .clients-kanban{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(230px,1fr))!important;
  gap:14px!important;
  align-items:start!important;
  overflow:visible!important;
  min-height:0!important;
  padding:0!important;
}
body.ui-2028 .crm-column{
  min-width:0!important;
  width:auto!important;
  min-height:230px!important;
  border-radius:22px!important;
  background:linear-gradient(145deg,rgba(7,21,41,.98),rgba(4,14,29,.96))!important;
  border:1px solid rgba(67,150,255,.30)!important;
  box-shadow:0 18px 50px rgba(0,0,0,.24)!important;
}
body.ui-2028 .crm-column>header{
  min-height:48px!important;
  padding:12px 14px!important;
  background:linear-gradient(135deg,rgba(19,52,96,.95),rgba(8,25,51,.92))!important;
}
body.ui-2028 .crm-column>header strong{
  font-size:.98rem!important;
  color:#f6fbff!important;
}
body.ui-2028 .crm-count{
  min-width:28px!important;
  padding:3px 8px!important;
}
body.ui-2028 .crm-dropzone{
  min-height:150px!important;
  max-height:none!important;
  overflow:visible!important;
  padding:10px!important;
  display:grid!important;
  gap:10px!important;
  align-content:start!important;
}
body.ui-2028 .crm-dropzone.drag-over{
  background:rgba(34,211,238,.11)!important;
  outline:2px dashed rgba(34,211,238,.74)!important;
  outline-offset:-7px!important;
}
body.ui-2028 .crm-empty-drop{
  min-height:44px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:10px!important;
  border-radius:14px!important;
  font-size:.85rem!important;
  color:#bfefff!important;
  border-color:rgba(34,211,238,.30)!important;
  background:rgba(3,13,27,.35)!important;
}
body.ui-2028 .crm-client-card{
  padding:12px!important;
  border-radius:18px!important;
  gap:7px!important;
  min-height:0!important;
  background:linear-gradient(145deg,rgba(12,35,68,.98),rgba(7,22,44,.97))!important;
}
body.ui-2028 .crm-client-card.crm-move-saved{
  outline:2px solid rgba(52,211,153,.9)!important;
  box-shadow:0 0 0 4px rgba(52,211,153,.12),0 18px 40px rgba(0,0,0,.28)!important;
}
body.ui-2028 .crm-card-top strong{
  font-size:.98rem!important;
  line-height:1.15!important;
}
body.ui-2028 .crm-card-line{
  font-size:.78rem!important;
  line-height:1.25!important;
  color:#c7dbf8!important;
}
body.ui-2028 .drag-pill{
  cursor:grab!important;
  background:rgba(34,211,238,.16)!important;
  color:#dffbff!important;
}
body.ui-2028 .crm-stage-badge{
  display:inline-flex!important;
  align-items:center!important;
  border-radius:999px!important;
  padding:4px 9px!important;
  background:linear-gradient(135deg,#1fb6ff,#7c3aed)!important;
  color:#fff!important;
  font-size:.72rem!important;
  font-weight:900!important;
  box-shadow:0 6px 14px rgba(31,182,255,.18)!important;
}
body.ui-2028 .client-status{
  font-size:.72rem!important;
  padding:4px 8px!important;
}
body.ui-2028 .crm-missing{
  padding:6px 8px!important;
  border-radius:10px!important;
  font-size:.78rem!important;
  max-height:46px!important;
  overflow:hidden!important;
}
body.ui-2028 .crm-client-card .btn.tiny{
  padding:7px 12px!important;
  border-radius:12px!important;
  font-size:.78rem!important;
}
@media(max-width:1200px){body.ui-2028 .clients-kanban{grid-template-columns:repeat(2,minmax(260px,1fr))!important;}}
@media(max-width:760px){body.ui-2028 .clients-kanban{grid-template-columns:1fr!important;}}

/* Stage 6.6.30 - context-aware top search + Clients CRM admin log */
.command-search{z-index:40;}
.global-search-panel{position:absolute;left:0;right:0;top:calc(100% + 10px);z-index:1000;background:rgba(7,17,31,.98);border:1px solid rgba(59,130,246,.42);border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.48);overflow:hidden;padding:8px;backdrop-filter:blur(18px);}
.global-search-panel-head{padding:8px 10px 10px;color:#9edcff;font-weight:900;font-size:12px;letter-spacing:.04em;text-transform:uppercase;border-bottom:1px solid rgba(148,163,184,.16);margin-bottom:6px;}
.global-search-result{width:100%;text-align:left;border:1px solid rgba(148,163,184,.16);background:rgba(15,32,61,.74);color:#eff6ff;border-radius:14px;padding:10px 12px;margin:7px 0;cursor:pointer;display:block;}
.global-search-result:hover{border-color:rgba(34,211,238,.5);background:rgba(37,99,235,.24);transform:translateY(-1px);}
.global-search-result strong{display:block;color:#fff;font-size:13px;margin-bottom:3px;}
.global-search-result span{display:block;color:#a8c7ee;font-size:12px;line-height:1.35;}
.global-search-empty{padding:12px;color:#c7d2fe;font-size:13px;}
.global-search-hidden{display:none!important;}
.global-search-hit{outline:1px solid rgba(34,211,238,.25);}
.global-search-focus{outline:3px solid rgba(34,211,238,.9)!important;box-shadow:0 0 0 6px rgba(34,211,238,.15),0 18px 55px rgba(34,211,238,.16)!important;}
.clients-log-shell{display:grid;gap:18px;}
.clients-log-toolbar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;align-items:end;}
.clients-log-toolbar label{display:grid;gap:6px;}
.clients-log-toolbar label span{font-size:11px;font-weight:900;color:#9bbcff;text-transform:uppercase;letter-spacing:.06em;}
.clients-log-table{width:100%;border-collapse:collapse;}
.clients-log-table th,.clients-log-table td{padding:12px;border-bottom:1px solid rgba(148,163,184,.16);vertical-align:top;}
.clients-log-table tr.clients-log-row{background:rgba(13,26,47,.38);}
.clients-log-table tr.clients-log-row:hover{background:rgba(37,99,235,.16);}
.clients-log-event{display:inline-flex;border-radius:999px;padding:4px 9px;background:rgba(56,189,248,.13);border:1px solid rgba(56,189,248,.28);color:#c8f3ff;font-weight:900;font-size:11px;}
.clients-log-details{max-width:560px;color:#c7d2fe;font-size:12px;line-height:1.45;word-break:break-word;}
.clients-log-client{font-weight:900;color:#fff;}
@media(max-width:1100px){.clients-log-toolbar{grid-template-columns:1fr 1fr;}.global-search-panel{position:fixed;left:18px;right:18px;top:86px;}}
@media(max-width:720px){.clients-log-toolbar{grid-template-columns:1fr;}}


/* Stage 6.6.31 - Clients CRM horizontal swimlane board
   Data-safe UI change only: make Clients board practical and shorter by using
   full-width rectangular rows with horizontal card scrolling. */
body.ui-2028 .clients-swimlane-board,
body.ui-2028 .clients-kanban.clients-swimlane-board{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:14px!important;
  align-items:stretch!important;
  overflow:visible!important;
  padding:0!important;
  min-height:0!important;
}
body.ui-2028 .clients-swimlane-board .crm-column{
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:220px minmax(0,1fr)!important;
  align-items:stretch!important;
  overflow:hidden!important;
  border-radius:24px!important;
  background:linear-gradient(135deg,rgba(7,21,41,.98),rgba(5,17,34,.96))!important;
  border:1px solid rgba(67,150,255,.32)!important;
}
body.ui-2028 .clients-swimlane-board .crm-column>header{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:center!important;
  gap:10px!important;
  min-height:132px!important;
  padding:16px!important;
  border-right:1px solid rgba(132,166,255,.18)!important;
  border-bottom:0!important;
  background:linear-gradient(145deg,rgba(23,55,104,.94),rgba(7,22,45,.96))!important;
}
body.ui-2028 .clients-swimlane-board .crm-column>header>div{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  min-width:0!important;
}
body.ui-2028 .clients-swimlane-board .crm-column>header strong{
  font-size:1.05rem!important;
  line-height:1.15!important;
  color:#ffffff!important;
  word-break:normal!important;
}
body.ui-2028 .clients-swimlane-board .crm-count{
  align-self:flex-start!important;
  min-width:34px!important;
  height:34px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0 10px!important;
  font-size:.92rem!important;
  background:rgba(31,182,255,.18)!important;
  border-color:rgba(31,182,255,.48)!important;
}
body.ui-2028 .clients-swimlane-board .crm-dropzone{
  min-height:132px!important;
  max-height:none!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  display:flex!important;
  flex-wrap:nowrap!important;
  gap:12px!important;
  align-items:stretch!important;
  align-content:stretch!important;
  padding:12px!important;
  scrollbar-width:thin!important;
  scroll-snap-type:x proximity!important;
}
body.ui-2028 .clients-swimlane-board .crm-dropzone::-webkit-scrollbar{height:10px!important;}
body.ui-2028 .clients-swimlane-board .crm-dropzone::-webkit-scrollbar-track{background:rgba(4,12,26,.58)!important;border-radius:999px!important;}
body.ui-2028 .clients-swimlane-board .crm-dropzone::-webkit-scrollbar-thumb{background:linear-gradient(90deg,#22d3ee,#7c3aed)!important;border-radius:999px!important;}
body.ui-2028 .clients-swimlane-board .crm-dropzone.drag-over{
  background:rgba(34,211,238,.12)!important;
  outline:2px dashed rgba(34,211,238,.76)!important;
  outline-offset:-8px!important;
}
body.ui-2028 .clients-swimlane-board .crm-client-card{
  flex:0 0 285px!important;
  width:285px!important;
  min-height:126px!important;
  scroll-snap-align:start!important;
  padding:12px!important;
  border-radius:18px!important;
  align-self:stretch!important;
}
body.ui-2028 .clients-swimlane-board .crm-client-card .crm-card-top strong{
  font-size:1rem!important;
  max-width:210px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.ui-2028 .clients-swimlane-board .crm-card-line{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.ui-2028 .clients-swimlane-board .crm-missing{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  max-height:34px!important;
}
body.ui-2028 .clients-swimlane-board .crm-empty-drop{
  flex:1 0 100%!important;
  min-height:106px!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  color:#9eefff!important;
  border:1px dashed rgba(34,211,238,.42)!important;
  background:rgba(3,13,27,.36)!important;
}
body.ui-2028 .clients-swimlane-board .drag-pill{
  cursor:grab!important;
  user-select:none!important;
}
body.ui-2028 .clients-swimlane-board .crm-client-card.dragging{opacity:.45!important;}
@media(max-width:900px){
  body.ui-2028 .clients-swimlane-board .crm-column{grid-template-columns:1fr!important;}
  body.ui-2028 .clients-swimlane-board .crm-column>header{min-height:66px!important;border-right:0!important;border-bottom:1px solid rgba(132,166,255,.18)!important;flex-direction:row!important;justify-content:space-between!important;align-items:center!important;}
  body.ui-2028 .clients-swimlane-board .crm-dropzone{min-height:140px!important;}
  body.ui-2028 .clients-swimlane-board .crm-client-card{flex-basis:260px!important;width:260px!important;}
}


/* Stage 6.6.32 - final CRM/communication polish, chat unread badge, company/user links */
body.ui-2028 .chat-top-badge{
  display:none; position:absolute; top:-7px; right:-7px; min-width:20px; height:20px; padding:0 6px;
  align-items:center; justify-content:center; border-radius:999px; background:#ef4444; color:#fff;
  font-size:10px; font-weight:950; line-height:20px; box-shadow:0 0 0 2px #07111f,0 8px 20px rgba(239,68,68,.36);
}
body.ui-2028 .top-chat-icon{position:relative;}
body.ui-2028 .company-users-link{color:#9eefff!important;text-decoration:none!important;font-weight:950;border-bottom:1px dotted rgba(158,239,255,.75);}
body.ui-2028 .company-users-link:hover{color:#fff!important;text-shadow:0 0 12px rgba(34,211,238,.55);}

/* Address Book saved contact cards */
body.ui-2028 .address-book-card,
body.ui-2028 .address-contact-card,
body.ui-2028 .address-contact-info>div,
body.ui-2028 .address-contact-notes,
body.ui-2028 .address-book-add-card{
  background:linear-gradient(180deg,rgba(9,24,46,.96),rgba(6,18,36,.98))!important;
  border:1px solid rgba(88,137,255,.36)!important;
  color:#ecf6ff!important;
  box-shadow:0 16px 36px rgba(0,0,0,.22)!important;
}
body.ui-2028 .address-contact-card h3,
body.ui-2028 .address-contact-card strong,
body.ui-2028 .address-contact-card span,
body.ui-2028 .address-contact-card summary,
body.ui-2028 .address-contact-card label span,
body.ui-2028 .address-contact-card .muted,
body.ui-2028 .address-contact-info span,
body.ui-2028 .address-contact-notes,
body.ui-2028 .address-book-card .muted{
  color:#d9ecff!important;
}
body.ui-2028 .address-contact-info strong{color:#ffffff!important;}
body.ui-2028 .address-contact-card details,
body.ui-2028 .address-contact-card details[open],
body.ui-2028 .address-contact-card .stacked-form,
body.ui-2028 .address-contact-card .compact-form{
  background:rgba(3,12,26,.92)!important;
  border:1px solid rgba(125,167,255,.30)!important;
  border-radius:16px!important;
  padding:12px!important;
  color:#ecf6ff!important;
}
body.ui-2028 .address-contact-card input,
body.ui-2028 .address-contact-card textarea,
body.ui-2028 .address-contact-card select,
body.ui-2028 .address-book-form input,
body.ui-2028 .address-book-form textarea,
body.ui-2028 .address-book-form select{
  background:#07111f!important;
  border:1px solid rgba(139,180,255,.52)!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

/* Internal Chat unread / automation notices */
body.ui-2028 .internal-chat-layout .chat-message,
body.ui-2028 .chat-message{
  background:linear-gradient(180deg,rgba(13,34,62,.96),rgba(8,24,46,.98))!important;
  border:1px solid rgba(88,137,255,.35)!important;
  color:#ecf6ff!important;
}
body.ui-2028 .chat-message strong,
body.ui-2028 .chat-message .muted,
body.ui-2028 .chat-message small{color:#cfe8ff!important;}
body.ui-2028 .chat-web-toast{background:linear-gradient(135deg,#102645,#1b2b65)!important;border:1px solid rgba(34,211,238,.42)!important;color:#fff!important;}

/* Replace remaining legacy light blocks across Humana/AUDIT result pages */
body.ui-2028 .audit-match-card,
body.ui-2028 .audit-match-card .table-wrap,
body.ui-2028 .audit-match-card table,
body.ui-2028 .audit-match-card tr,
body.ui-2028 .audit-match-card td,
body.ui-2028 .audit-match-card th,
body.ui-2028 .audit-summary-grid .metric-card,
body.ui-2028 .audit-result-card,
body.ui-2028 .audit-case-card,
body.ui-2028 .audit-preview-card,
body.ui-2028 .humana-case-card,
body.ui-2028 .matched-issue-row{
  background:linear-gradient(180deg,rgba(8,22,42,.98),rgba(5,16,32,.98))!important;
  color:#ecf6ff!important;
  border-color:rgba(88,137,255,.34)!important;
}
body.ui-2028 .audit-match-card h3,
body.ui-2028 .audit-match-card h4,
body.ui-2028 .audit-match-card strong,
body.ui-2028 .audit-match-card td,
body.ui-2028 .audit-match-card th,
body.ui-2028 .audit-match-card p,
body.ui-2028 .audit-match-card .muted,
body.ui-2028 .humana-case-card,
body.ui-2028 .humana-case-card *{color:#eaf6ff!important;}
body.ui-2028 .audit-match-card .flash.success,
body.ui-2028 .audit-match-card .notice.success{
  background:rgba(22,163,74,.16)!important;border-color:rgba(74,222,128,.45)!important;color:#d9ffe7!important;
}
body.ui-2028 .audit-match-card .badge,
body.ui-2028 .audit-result-card .badge{color:#fff!important;}

/* Generic late-stage white panels without touching PDF page images */
body.ui-2028 .card:not(.pdf-page-card):not(.pdf-canvas-card),
body.ui-2028 .panel,
body.ui-2028 .form-panel,
body.ui-2028 .summary-card,
body.ui-2028 .table-wrap:not(.pdf-table),
body.ui-2028 details:not(.native-details){
  color:#ecf6ff;
}
body.ui-2028 .card:not(.pdf-page-card):not(.pdf-canvas-card) .muted,
body.ui-2028 .card:not(.pdf-page-card):not(.pdf-canvas-card) small,
body.ui-2028 .card:not(.pdf-page-card):not(.pdf-canvas-card) p,
body.ui-2028 .card:not(.pdf-page-card):not(.pdf-canvas-card) label span,
body.ui-2028 .card:not(.pdf-page-card):not(.pdf-canvas-card) h2,
body.ui-2028 .card:not(.pdf-page-card):not(.pdf-canvas-card) h3{
  color:#d8eaff!important;
}
body.ui-2028 .card:not(.pdf-page-card):not(.pdf-canvas-card) input,
body.ui-2028 .card:not(.pdf-page-card):not(.pdf-canvas-card) textarea,
body.ui-2028 .card:not(.pdf-page-card):not(.pdf-canvas-card) select{
  background:#07111f!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border-color:rgba(139,180,255,.52)!important;
}

/* Company/CRM naming polish */
body.ui-2028 .clients-board-top h2::first-letter{text-transform:uppercase;}

/* Dashboard card cursor after customize removal */
body.ui-2028 .dashboard-quick-card,
body.ui-2028 .metric-card,
body.ui-2028 .quick-tile,
body.ui-2028 .dash-kpi,
body.ui-2028 .workflow-card{cursor:pointer!important;}
body.ui-2028 .dashboard-quick-card:hover,
body.ui-2028 .metric-card:hover,
body.ui-2028 .quick-tile:hover,
body.ui-2028 .dash-kpi:hover{transform:translateY(-2px);filter:brightness(1.08);}
