:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-2: #f8fbff;
  --ink: #0f172a;
  --muted: #667085;
  --line: #dbe4ef;
  --shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
  --nav: #071220;
  --nav-2: #0c1a2d;
  --nav-3: #132842;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #0b63ce;
  --blue-700: #0a4fa8;
  --green-50: #ecfdf3;
  --green-700: #027a48;
  --amber-50: #fffaeb;
  --amber-700: #b54708;
  --red-50: #fef3f2;
  --red-700: #b42318;
  --purple-50: #f5f3ff;
  --purple-700: #6b4eff;
  --teal-50: #f0fdfa;
  --teal-700: #0f766e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(11, 99, 206, 0.09), transparent 34%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 28%),
    var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

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

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, var(--blue-500), var(--blue-700));
  box-shadow: 0 10px 18px rgba(11, 99, 206, 0.18);
}

button:hover { filter: brightness(0.98); }

button:disabled {
  cursor: not-allowed;
  opacity: 0.64;
  box-shadow: none;
}

button.secondary,
.secondary,
#previewBtn,
#expandBtn,
#clearPlanFilterBtn,
#refreshMyInspectionsBtn,
.nav-disabled {
  background: #f3f7fc;
  color: #1b2739;
  border: 1px solid var(--line);
  box-shadow: none;
}

.danger,
.danger-soft {
  color: var(--red-700) !important;
  background: var(--red-50) !important;
  border-color: #fecaca !important;
}

.small {
  padding: 8px 12px;
  font-size: 12px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(11, 99, 206, 0.12);
}

textarea { resize: vertical; }

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 16px 18px;
  color: #dbe6f3;
  background:
    radial-gradient(circle at top, rgba(41, 89, 149, 0.7), transparent 38%),
    linear-gradient(180deg, var(--nav-2), var(--nav) 55%, #050d17);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(180deg, #1a7df0, #0a57c4);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
}

.brand-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin-top: 2px;
  font-size: 13px;
  color: #9eb2ca;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.side-label {
  margin: 14px 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 800;
  color: #8fa4bb;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  color: #dce6f3;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  border-radius: 12px;
}

.nav-item span {
  width: 20px;
  text-align: center;
  opacity: 0.96;
}

.nav-parent {
  justify-content: flex-start;
}

.nav-parent-label {
  flex: 1;
  text-align: left;
}

.nav-caret {
  margin-left: auto;
  width: 16px !important;
  opacity: 0.72;
  font-size: 11px;
}

.nav-children {
  display: grid;
  gap: 6px;
  padding: 0 0 0 18px;
  margin-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-child {
  padding-left: 12px;
  color: #c9d7e9;
  font-size: 14px;
}

.nav-child span {
  width: 18px;
}

.nav-child.active {
  color: #fff;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(180deg, #1776dd, #0a57c4);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.18);
}

.nav-parent.active {
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.18);
}

.nav-disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.user-card {
  margin-top: auto;
  padding: 16px 8px 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #0f172a;
  background: #eaf2ff;
  font-weight: 900;
}

.avatar.small {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.user-card strong, .user-card small { display: block; }

.user-card small { color: #9eb2ca; margin-top: 2px; }

.workspace { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(219, 228, 239, 0.9);
}

.top-title {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.top-title h1 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.top-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-button,
.round-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f4f8fd;
  color: #142033;
  border: 1px solid var(--line);
  box-shadow: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.company-pill {
  padding: 9px 12px;
  border-radius: 999px;
  background: #f5f9ff;
  border: 1px solid var(--line);
  color: #142033;
  font-size: 13px;
  white-space: nowrap;
}

.company-pill strong { color: var(--blue-500); }

.top-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #132033;
  white-space: nowrap;
}

.dashboard-view,
.run-view,
.content-card,
.summary-card,
.search-panel {
  min-width: 0;
}

.dashboard-view,
.run-view,
.content-card,
.summary-card {
  margin: 22px 28px 0;
}

.run-view {
  margin: 28px 40px 0;
}

.dashboard-empty-slot:empty {
  display: none;
}

.empty-state-card,
.dashboard-empty-slot > .empty-state-card {
  border-radius: 18px;
  padding: 20px 22px;
  background: linear-gradient(180deg, #0d1727, #0b1623);
  color: #e8eef8;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.empty-state-card strong {
  display: block;
  font-size: 20px;
  margin-bottom: 6px;
}

.empty-state-card p {
  margin: 0;
  color: #b7c4d7;
}

.search-panel,
.summary-card,
.content-card,
.dash-card,
.kpi-card,
.builder-list,
.builder-question-panel,
.rule-editor,
.builder-card,
.my-inspection-row,
.plan-row {
  background: var(--panel);
  border: 1px solid rgba(219, 228, 239, 0.8);
  border-radius: 22px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
}

.run-view {
  display: grid;
  gap: 22px;
  position: relative;
}

.run-view::before {
  content: "";
  position: absolute;
  inset: -30px 0 auto;
  height: 260px;
  border-radius: 36px;
  background:
    radial-gradient(circle at 16% 20%, rgba(11, 99, 206, 0.18), transparent 34%),
    radial-gradient(circle at 82% 0%, rgba(15, 118, 110, 0.12), transparent 32%);
  pointer-events: none;
  z-index: -1;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 0;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.job-search-card,
.search-help {
  min-width: 0;
}
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 900;
}

.job-search-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 251, 255, 0.82));
  border-right: 1px solid rgba(219, 228, 239, 0.82);
}

.job-search-card label {
  margin-bottom: 10px;
  color: #0e1b2e;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  color: #132033;
}

.job-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 7px;
  border: 1px solid rgba(199, 216, 237, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 14px 32px rgba(15, 23, 42, 0.055);
}

.job-search:focus-within {
  border-color: rgba(11, 99, 206, 0.5);
  box-shadow:
    0 0 0 4px rgba(11, 99, 206, 0.1),
    0 16px 34px rgba(15, 23, 42, 0.08);
}

.job-search input {
  border: 0;
  background: transparent;
  font-size: 18px;
  box-shadow: none;
}

.job-search input:focus {
  box-shadow: none;
}

.job-search button {
  min-width: 132px;
  border-radius: 14px;
}

.search-help {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 252, 255, 0.88));
  color: #40516b;
}

.search-help-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #0b63ce;
  background: linear-gradient(180deg, #eff6ff, #e0edff);
  border: 1px solid #c7ddff;
  font-weight: 900;
}

.search-help strong {
  display: block;
  margin-bottom: 4px;
  color: #12213a;
}

.search-help p {
  margin: 0;
  line-height: 1.48;
}

.status {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--red-700);
}

.job-search-card .status {
  margin-top: 12px;
  color: #36506f;
  font-size: 13px;
}

.summary-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 20px;
  padding: 22px;
}

.summary-block {
  padding-right: 20px;
  border-right: 1px solid var(--line);
}

.summary-block:last-child {
  border-right: 0;
  padding-right: 0;
}

.summary-block .label {
  color: var(--blue-500);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-block strong {
  display: block;
  margin: 12px 0 14px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.summary-block p {
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.summary-block b {
  color: #0f4ca2;
}

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

.mini-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-empty-slot > .empty-state-card {
  margin: 0 0 18px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 28px 0;
}

.kpi-card {
  padding: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

.kpi-card strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  letter-spacing: -0.05em;
}

.kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.kpi-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 900;
}

.kpi-icon.blue { color: #0b63ce; background: var(--blue-50); }
.kpi-icon.green { color: var(--green-700); background: var(--green-50); }
.kpi-icon.amber { color: var(--amber-700); background: var(--amber-50); }
.kpi-icon.red { color: var(--red-700); background: var(--red-50); }
.kpi-icon.purple { color: var(--purple-700); background: var(--purple-50); }
.kpi-icon.teal { color: var(--teal-700); background: var(--teal-50); }

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

.dash-card {
  padding: 18px;
  min-width: 0;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.dash-card.wide {
  grid-column: 1 / -1;
}

.dash-card-header,
.section-header,
.builder-panel-header,
.builder-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dash-card-header h3,
.section-header h2,
.builder-card-header h3 {
  margin: 0;
}

.plans-panel {
  padding: 0;
  overflow: hidden;
  border-color: rgba(196, 211, 231, 0.84);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 252, 255, 0.9)),
    radial-gradient(circle at 15% 0%, rgba(11, 99, 206, 0.07), transparent 30%);
  box-shadow: 0 26px 76px rgba(15, 23, 42, 0.09);
}

.plans-panel .section-header {
  padding: 24px 26px 18px;
  border-bottom: 1px solid rgba(219, 228, 239, 0.76);
  background: rgba(255, 255, 255, 0.54);
}

.plans-panel .section-header h2 {
  margin-top: 8px;
  font-size: 30px;
  letter-spacing: -0.045em;
}

.section-kicker {
  color: #0b63ce;
}

.toolbar,
.plan-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-toolbar {
  padding: 8px;
  border: 1px solid rgba(219, 228, 239, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.plan-toolbar input {
  min-width: 260px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.plan-toolbar input:focus {
  box-shadow: none;
}

.plan-toolbar button {
  border-radius: 12px;
}

.dash-card-header .muted,
.section-header p,
.builder-help,
.muted {
  color: var(--muted);
}

.table-shell {
  overflow: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.mini-table,
.questions-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.mini-table th,
.mini-table td,
.questions-table th,
.questions-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e9eef5;
  vertical-align: top;
}

.mini-table th,
.questions-table th {
  background: #f8fbff;
  color: #132033;
  font-size: 13px;
  text-align: left;
}

.mini-table tbody tr:hover,
.questions-table tbody tr:hover {
  background: #f9fbff;
}

.muted-cell {
  color: var(--muted);
}

.status-chip,
.status-badge,
.required-pill,
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip.submitted,
.status-badge.submitted {
  color: var(--green-700);
  background: var(--green-50);
  border: 1px solid #a7f3d0;
}

.status-chip.draft,
.status-badge.draft {
  color: var(--amber-700);
  background: var(--amber-50);
  border: 1px solid #fcd34d;
}

.status-chip.warning {
  color: var(--amber-700);
  background: var(--amber-50);
  border: 1px solid #fcd34d;
}

.status-chip.info {
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid #bfdbfe;
}

.required-pill {
  color: #0f4ca2;
  background: var(--blue-50);
  border: 1px solid #bfdbfe;
}

.required-pill.optional {
  color: var(--muted);
  background: #f3f7fc;
  border-color: var(--line);
}

.badge {
  margin-right: 8px;
  color: #0f4ca2;
  background: var(--blue-50);
  border: 1px solid #bfdbfe;
}

.plans-grid {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.plans-grid.empty-state {
  place-items: center;
  min-height: 300px;
  text-align: center;
  color: var(--muted);
}

.plans-grid.empty-state .empty-state-card {
  position: relative;
  max-width: 460px;
  margin: 10px auto;
  padding: 56px 34px 30px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    radial-gradient(circle at top, rgba(11, 99, 206, 0.08), transparent 55%);
  color: #132033;
  border: 1px solid rgba(203, 217, 235, 0.9);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.09);
}

.plans-grid.empty-state .empty-state-card::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 5px;
  background: #0b63ce;
  box-shadow:
    -24px 24px 0 #dbeafe,
    24px 24px 0 #dbeafe,
    0 48px 0 #bfdbfe;
}

.plans-grid.empty-state .empty-state-card strong {
  color: #111c2f;
  font-size: 22px;
}

.plans-grid.empty-state .empty-state-card p {
  color: #667085;
}

.plan-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #ffffff, #fbfdff),
    radial-gradient(circle at 0% 50%, rgba(11, 99, 206, 0.08), transparent 28%);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.plan-row:hover {
  border-color: rgba(11, 99, 206, 0.28);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.plan-icon {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #eef6ff, #dcecff);
  color: var(--blue-500);
  border: 1px solid #c8ddff;
  font-weight: 900;
}

.plan-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.plan-title-line strong {
  font-size: 19px;
  letter-spacing: -0.025em;
}

.plan-content .muted {
  margin-top: 6px;
}

.plan-row > button {
  min-width: 132px;
  border-radius: 14px;
}

.question-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 32px 10px;
}

.question-search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.question-search-wrap span {
  position: absolute;
  left: 13px;
  top: 11px;
  color: var(--muted);
}

.question-search-wrap input { padding-left: 38px; }

.questions-table-wrap {
  flex: 1 1 auto;
  overflow: auto;
  margin: 0 32px;
  border: 1px solid rgba(190, 207, 229, 0.86);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  min-height: 360px;
  max-height: none;
}

.questions-table {
  min-width: 900px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 32px 24px;
  border-top: 1px solid rgba(219, 228, 239, 0.72);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.status.dialog-status {
  color: #334155;
}

.dialog-shell {
  display: flex;
  flex-direction: column;
  height: min(94vh, 1040px);
  max-height: 94vh;
  border-radius: 28px;
  background:
    radial-gradient(circle at 10% -20%, rgba(11, 99, 206, 0.1), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  overflow: auto;
}

dialog {
  width: min(1720px, 98vw);
  max-height: 94vh;
  border: 0;
  border-radius: 28px;
  padding: 0;
  overflow: visible;
  box-shadow: 0 42px 100px rgba(15, 23, 42, 0.42);
  background: transparent;
}

dialog::backdrop {
  background: rgba(5, 10, 20, 0.68);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 36px 20px;
  border-bottom: 1px solid rgba(219, 228, 239, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(241, 247, 255, 0.86)),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.1), transparent 35%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-500);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 900;
  font-size: 12px;
}

.dialog-header h2 {
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.close-btn {
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 999px;
  background: #f1f6fd;
  color: #0f172a;
  border: 1px solid #cfe0f7;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  font-size: 30px;
}

.dialog-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 32px 12px;
  border-bottom: 1px solid rgba(219, 228, 239, 0.72);
  background: rgba(248, 251, 255, 0.72);
}

.dialog-progress div {
  padding: 12px 16px;
  border: 1px solid rgba(203, 217, 235, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.045);
}

.dialog-progress span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  font-size: 12px;
}

.dialog-progress strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.dialog-status {
  margin: 14px 32px 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.76);
  border: 1px solid rgba(191, 219, 254, 0.78);
  width: fit-content;
  max-width: calc(100% - 64px);
}

.questions-table-wrap,
.dialog-actions,
.question-tools,
.dialog-progress,
.dialog-header,
.rule-editor {
  position: relative;
  z-index: 1;
}

.question-row.is-valid {
  background: rgba(236, 253, 243, 0.55);
}

.question-row.is-invalid {
  background: rgba(254, 243, 242, 0.62);
}

.question-row.is-focus-target {
  background: rgba(236, 244, 255, 0.84);
  box-shadow: inset 0 0 0 2px rgba(11, 99, 206, 0.18);
}

.question-row.condition-hidden {
  display: none;
}

.question-row td:first-child {
  width: 56%;
}

.question-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.outline-question {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding-left: var(--indent);
}

.outline-number {
  font-weight: 900;
  color: var(--blue-500);
  min-width: 48px;
}

.outline-text {
  font-weight: 800;
  color: #132033;
}

.autofill-note {
  align-self: flex-start;
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--teal-700);
  background: var(--teal-50);
  border: 1px solid #99f6e4;
  font-size: 11px;
  font-weight: 900;
}

.question-extra {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.accepted-values,
.autofill-source,
.validation-source,
.condition-source {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f8fbff;
  border: 1px solid var(--line);
  color: #31435d;
}

.tooltip-chip {
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue-500);
  border: 1px solid #bfdbfe;
  box-shadow: none;
}

.tooltip-popover {
  position: fixed;
  z-index: 2147483647;
  max-width: min(380px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 14px;
  background: #0b1626;
  color: #e8eef8;
  box-shadow: 0 26px 60px rgba(2, 6, 23, 0.45);
  pointer-events: none;
}

.tooltip-popover div + div {
  margin-top: 6px;
}

.question-row .answer-control.auto-filled {
  background: #f8fbff;
  border-color: #cfe3ff;
}

.my-inspection-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 0;
}

.my-inspection-kpis article {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.my-inspection-kpis span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.my-inspection-kpis strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.my-inspections-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.my-inspection-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.my-inspection-status {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 900;
}

.my-inspection-status.submitted {
  color: var(--green-700);
  background: var(--green-50);
}

.my-inspection-status.draft {
  color: var(--amber-700);
  background: var(--amber-50);
}

.my-inspection-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.my-inspection-title strong {
  font-size: 18px;
}

.my-inspection-meta {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.mini-progress {
  margin-top: 12px;
  width: 100%;
  max-width: 420px;
  height: 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), #4f8ef7);
}

.my-inspection-stats strong {
  display: block;
  font-size: 20px;
}

.my-inspection-stats span,
.my-inspection-stats small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.my-inspection-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  grid-template-areas:
    "plans questions"
    "plans editor";
  gap: 16px;
  align-items: start;
}

.builder-list,
.builder-question-panel,
.rule-editor {
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.builder-list {
  grid-area: plans;
}

.builder-question-panel {
  grid-area: questions;
  min-height: 0;
}

.rule-editor {
  grid-area: editor;
  max-width: none;
}

.builder-search {
  margin-bottom: 12px;
}

.rule-list,
.rule-question-list {
  display: grid;
  gap: 10px;
}

.plan-group-card,
.rule-item {
  width: 100%;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(219, 228, 239, 0.9);
  background: linear-gradient(180deg, #fff, #fbfdff);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.plan-group-card.active,
.rule-item.active {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, var(--blue-50), #fff);
  box-shadow: 0 12px 24px rgba(11, 99, 206, 0.12);
}

.plan-card-title,
.rule-body strong {
  display: block;
  font-weight: 900;
}

.plan-card-meta,
.rule-body small,
.rule-body span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.rule-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.rule-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--blue-500);
  font-weight: 900;
}

.rule-editor {
  display: grid;
  gap: 14px;
}

.builder-grid > * {
  min-width: 0;
}

.builder-grid input,
.builder-grid select,
.builder-grid textarea {
  min-width: 0;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.builder-card {
  padding: 14px;
}

.builder-card-header {
  margin-bottom: 12px;
}

.value-list,
.rule-lines {
  display: grid;
  gap: 10px;
}

.value-row,
.logic-line {
  display: grid;
  gap: 10px;
  align-items: center;
}

.value-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.logic-line {
  grid-template-columns: 108px minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 0.8fr) auto;
}

.logic-line.condition-line {
  grid-template-columns: 128px minmax(0, 1fr) 112px minmax(0, 0.9fr) 100px auto;
}

.value-row input,
.logic-line input,
.logic-line select {
  width: 100%;
}

.logic-prefix {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}

.empty-rule-list {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: #fafcff;
}

.json-preview {
  margin: 12px 32px 0;
  border-radius: 16px;
  padding: 16px;
  background: #0b1626;
  color: #dbeafe;
  overflow: auto;
  max-height: 300px;
}

.hidden { display: none !important; }

.outline-level-2 .outline-text,
.outline-level-3 .outline-text,
.outline-level-4 .outline-text,
.outline-level-5 .outline-text {
  letter-spacing: -0.01em;
}

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .builder-grid {
    grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
    grid-template-areas:
      "plans questions"
      "plans editor";
  }

  .rule-editor {
    grid-column: auto;
    max-width: none;
  }

  .builder-list {
    max-width: none;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .search-help {
    border-top: 1px solid rgba(219, 228, 239, 0.82);
  }
}

@media (min-width: 961px) and (max-width: 1500px) {
  .app-shell {
    grid-template-columns: 268px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 14px 16px;
  }

  .brand {
    padding-bottom: 14px;
  }

  .brand-title {
    font-size: 18px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .nav-item {
    padding: 10px 12px;
    font-size: 14px;
  }

  .topbar {
    min-height: 72px;
    padding: 10px 20px;
  }

  .top-title {
    gap: 12px;
  }

  .top-title h1 {
    font-size: 21px;
  }

  .top-title p {
    font-size: 12px;
  }

  .icon-button,
  .round-button {
    width: 36px;
    height: 36px;
  }

  .company-pill {
    padding: 8px 11px;
    font-size: 12px;
  }

  .dashboard-view,
  .run-view,
  .content-card,
  .summary-card {
    margin-left: 20px;
    margin-right: 20px;
  }

  .run-view {
    margin-top: 20px;
  }

  .kpi-grid,
  .dashboard-grid {
    margin-left: 20px;
    margin-right: 20px;
  }

  .kpi-grid {
    gap: 12px;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-card strong {
    font-size: 26px;
  }

  .search-panel {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  }

  .job-search-card,
  .search-help {
    padding: 22px;
  }

  .job-search input {
    font-size: 16px;
  }

  .summary-card {
    padding: 18px;
    gap: 16px;
  }

  .summary-block strong {
    font-size: 24px;
    margin: 10px 0 12px;
  }

  .section-header h2,
  .dash-card-header h3,
  .builder-card-header h3,
  .builder-panel-header strong {
    font-size: 18px;
  }

  .plans-panel .section-header {
    padding: 20px 22px 16px;
  }

  .plans-panel .section-header h2 {
    font-size: 26px;
  }

  .content-card,
  .summary-card,
  .dash-card {
    border-radius: 20px;
  }

  .builder-list,
  .builder-question-panel,
  .rule-editor {
    padding: 14px;
    border-radius: 20px;
  }

  .builder-grid {
    gap: 14px;
  }

  .plan-group-card,
  .rule-item {
    padding: 12px;
    border-radius: 16px;
  }

  .rule-editor {
    gap: 12px;
  }

  .builder-card {
    padding: 12px;
    border-radius: 18px;
  }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
  }

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

  .top-actions {
    justify-content: flex-start;
  }

  .dashboard-view,
  .run-view,
  .content-card,
  .summary-card,
  .kpi-grid {
    margin-left: 16px;
    margin-right: 16px;
  }

  .search-panel,
  .summary-card,
  .my-inspection-row,
  .plan-row,
  .my-inspection-kpis,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .job-search-card,
  .search-help {
    padding: 22px;
  }

  .job-search-card {
    border-right: 0;
    border-top: 1px solid rgba(219, 228, 239, 0.82);
  }

  .plans-panel .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .plan-toolbar {
    width: 100%;
  }

  .plan-toolbar input {
    min-width: 0;
  }

  .summary-block,
  .my-inspection-row,
  .plan-row {
    border-right: 0;
  }

  .mini-table,
  .questions-table {
    min-width: 820px;
  }

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

  .builder-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "plans"
      "questions"
      "editor";
  }

  .builder-list,
  .builder-question-panel,
  .rule-editor {
    max-width: none;
  }

  .dialog-header,
  .dialog-progress,
  .question-tools,
  .dialog-actions {
    padding-left: 18px;
    padding-right: 18px;
  }

  .questions-table-wrap,
  .json-preview {
    margin-left: 18px;
    margin-right: 18px;
  }

  .questions-table-wrap {
    min-height: 280px;
  }
}

@media (max-width: 640px) {
  .top-title {
    align-items: flex-start;
  }

  .kpi-grid,
  .my-inspection-kpis {
    grid-template-columns: 1fr;
  }

  .form-grid.two,
  .form-grid.three,
  .logic-line,
  .logic-line.condition-line,
  .value-row {
    grid-template-columns: 1fr;
  }

  .dialog-progress {
    grid-template-columns: 1fr;
  }

  .questions-table-wrap {
    min-height: 220px;
  }

  .dialog-actions,
  .editor-actions {
    flex-direction: column;
  }

  .builder-grid {
    gap: 12px;
  }

  .builder-card,
  .builder-list,
  .builder-question-panel,
  .rule-editor {
    padding: 14px;
  }

  .job-search {
    grid-template-columns: 1fr;
  }

  .job-search button,
  .plan-row > button {
    width: 100%;
  }

  .plan-toolbar {
    flex-direction: column;
  }

  .plan-toolbar button {
    width: 100%;
  }
}

/* Production polish: dense, work-focused inspection UI. */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #111827;
  --muted: #64748b;
  --line: #d8e0ea;
  --shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
  --nav: #07111f;
  --nav-2: #0d1b2d;
  --blue-50: #edf5ff;
  --blue-100: #d8eaff;
  --blue-500: #0b63ce;
  --blue-700: #084a9d;
}

body {
  background: var(--bg);
}

button,
input,
select,
textarea,
.nav-item,
.brand-icon,
.avatar,
.search-panel,
.summary-card,
.content-card,
.dash-card,
.kpi-card,
.builder-list,
.builder-question-panel,
.rule-editor,
.builder-card,
.my-inspection-row,
.plan-row,
.table-shell,
.questions-table-wrap,
.plan-toolbar,
.job-search,
.empty-state-card {
  border-radius: 8px;
}

button {
  padding: 9px 13px;
  min-height: 38px;
  box-shadow: none;
}

button:hover {
  filter: none;
  transform: translateY(-1px);
}

input,
select,
textarea {
  border-radius: 7px;
  padding: 9px 10px;
  min-height: 38px;
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(11, 99, 206, 0.12);
}

.app-shell {
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  padding: 16px 12px;
  background: linear-gradient(180deg, #0d1b2d, #07111f);
}

.brand {
  gap: 10px;
  padding: 4px 6px 14px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  font-size: 19px;
  box-shadow: none;
}

.brand-title {
  font-size: 17px;
  letter-spacing: 0;
}

.brand-subtitle {
  font-size: 12px;
}

.nav {
  gap: 5px;
}

.side-label {
  margin: 12px 8px 4px;
  font-size: 10px;
  letter-spacing: 0.09em;
}

.nav-item {
  padding: 9px 10px;
  gap: 10px;
  font-size: 14px;
}

.nav-item span {
  width: 18px;
}

.nav-item.active,
.nav-parent.active {
  box-shadow: none;
}

.nav-children {
  gap: 4px;
  padding-left: 14px;
  margin-left: 9px;
}

.nav-child {
  font-size: 13px;
  padding-left: 10px;
}

.user-card {
  padding: 12px 6px 0;
}

.avatar {
  width: 34px;
  height: 34px;
}

.avatar.small {
  width: 26px;
  height: 26px;
}

.topbar {
  min-height: 62px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.95);
}

.top-title {
  gap: 10px;
}

.top-title h1 {
  font-size: 19px;
  letter-spacing: 0;
}

.top-title p {
  margin-top: 2px;
  font-size: 12px;
}

.icon-button,
.round-button {
  width: 34px;
  height: 34px;
}

.top-actions {
  gap: 8px;
}

.company-pill {
  padding: 7px 10px;
  font-size: 12px;
}

.dashboard-view,
.run-view,
.content-card,
.summary-card {
  margin: 16px 20px 0;
}

.run-view {
  gap: 14px;
}

.run-view::before {
  display: none;
}

.content-card {
  padding: 18px;
}

.plans-panel {
  padding: 0;
}

.section-header {
  align-items: flex-start;
  padding-bottom: 12px;
}

.section-header h2,
.plans-panel .section-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.section-header p {
  margin: 5px 0 0;
  font-size: 13px;
}

.section-kicker {
  display: none;
}

.search-panel {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.job-search-card,
.search-help {
  padding: 16px;
}

.job-search-card label {
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0;
}

.job-search {
  gap: 8px;
  padding: 4px;
  border-radius: 8px;
  box-shadow: none;
}

.job-search input {
  font-size: 15px;
}

.job-search button {
  min-width: 112px;
}

.search-help {
  gap: 10px;
}

.search-help-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.search-help p {
  font-size: 13px;
  line-height: 1.35;
}

.summary-card {
  grid-template-columns: 1.1fr 0.9fr 0.9fr;
  gap: 14px;
  padding: 15px 18px;
  box-shadow: var(--shadow);
}

.summary-block {
  padding-right: 14px;
}

.summary-block .label {
  font-size: 11px;
  letter-spacing: 0.07em;
}

.summary-block strong {
  margin: 8px 0 10px;
  font-size: 22px;
  letter-spacing: 0;
}

.summary-block p,
.mini-grid span {
  font-size: 12px;
}

.kpi-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 20px 0;
}

.kpi-card {
  padding: 12px;
  box-shadow: var(--shadow);
}

.kpi-card span,
.kpi-card small {
  font-size: 12px;
}

.kpi-card span {
  margin-top: 8px;
}

.kpi-card strong {
  margin-top: 7px;
  font-size: 24px;
  letter-spacing: 0;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.dashboard-grid {
  gap: 12px;
  margin: 12px 20px 0;
}

.dash-card {
  padding: 14px;
  box-shadow: var(--shadow);
}

.dash-card-header h3,
.builder-card-header h3 {
  font-size: 16px;
}

.table-shell {
  margin-top: 10px;
}

.mini-table,
.questions-table {
  min-width: 680px;
}

.dash-card:not(.wide) .mini-table {
  min-width: 0;
}

.dash-card:not(.wide) .mini-table th,
.dash-card:not(.wide) .mini-table td {
  padding: 8px 10px;
}

.mini-table th,
.mini-table td,
.questions-table th,
.questions-table td {
  padding: 9px 11px;
}

.mini-table th,
.questions-table th {
  font-size: 12px;
}

.plans-panel .section-header {
  padding: 16px 18px 12px;
}

.plan-toolbar {
  padding: 4px;
  border-radius: 8px;
}

.plan-toolbar input {
  min-width: 220px;
}

.plans-grid {
  gap: 8px;
  padding: 12px;
}

.plans-grid.empty-state {
  min-height: 220px;
}

.plans-grid.empty-state .empty-state-card {
  max-width: 380px;
  margin: 0 auto;
  padding: 22px;
  box-shadow: var(--shadow);
}

.plans-grid.empty-state .empty-state-card::before {
  display: none;
}

.plans-grid.empty-state .empty-state-card strong {
  font-size: 17px;
}

.plan-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.plan-row:hover {
  background: #f8fbff;
  border-color: rgba(11, 99, 206, 0.28);
  box-shadow: var(--shadow);
  transform: none;
}

.plan-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.plan-title-line {
  gap: 8px;
}

.plan-title-line strong {
  font-size: 16px;
  letter-spacing: 0;
}

.plan-content .muted {
  margin-top: 4px;
  font-size: 13px;
}

.plan-row > button {
  min-width: 108px;
  border-radius: 8px;
}

.status-chip,
.status-badge,
.required-pill,
.badge,
.pill {
  padding: 3px 8px;
  font-size: 11px;
}

.my-inspection-kpis {
  gap: 10px;
  margin-top: 12px;
}

.my-inspection-kpis article {
  padding: 12px;
  border-radius: 8px;
  box-shadow: none;
}

.my-inspection-kpis strong {
  font-size: 22px;
}

.my-inspections-list {
  gap: 8px;
  margin-top: 12px;
}

.my-inspection-row {
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 12px;
}

.my-inspection-status {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.my-inspection-title strong {
  font-size: 16px;
}

.my-inspection-meta {
  margin-top: 5px;
  font-size: 13px;
}

.mini-progress {
  margin-top: 8px;
  height: 7px;
}

.builder-grid {
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 12px;
}

.builder-list,
.builder-question-panel,
.rule-editor {
  padding: 12px;
}

.builder-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.builder-panel-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.builder-panel-header strong {
  font-size: 15px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#logicBuilderView .builder-panel-header button {
  flex: 0 0 auto;
  align-self: center;
}

.rule-list,
.rule-question-list {
  gap: 8px;
}

.plan-group-card,
.rule-item {
  padding: 10px;
  border-radius: 8px;
}

.rule-item {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
}

.rule-number {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.rule-editor {
  gap: 12px;
}

.form-grid {
  gap: 10px;
}

.builder-card {
  padding: 12px;
  box-shadow: none;
}

.logic-line {
  grid-template-columns: 96px minmax(0, 1fr) minmax(0, 0.75fr) minmax(0, 0.95fr) auto;
}

.logic-line.condition-line {
  grid-template-columns: 96px minmax(0, 1fr) 100px minmax(0, 0.75fr) 124px auto;
}

dialog {
  width: min(1480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border-radius: 10px;
}

.dialog-shell {
  height: min(92vh, 900px);
  max-height: calc(100vh - 32px);
  border-radius: 10px;
  background: #ffffff;
}

.dialog-header {
  padding: 18px 22px 14px;
  background: #ffffff;
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.dialog-header h2 {
  font-size: 26px;
  letter-spacing: 0;
}

.close-btn {
  width: 42px;
  height: 42px;
  font-size: 24px;
  box-shadow: none;
}

.dialog-progress {
  gap: 10px;
  padding: 12px 22px;
}

.dialog-progress div {
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: none;
}

.dialog-progress span {
  font-size: 11px;
}

.dialog-progress strong {
  font-size: 21px;
}

.dialog-status {
  margin: 10px 22px 0;
  max-width: calc(100% - 44px);
  border-radius: 8px;
}

.question-tools {
  padding: 12px 22px 8px;
}

.question-search-wrap {
  max-width: 360px;
}

.questions-table-wrap {
  margin: 0 22px;
  border-radius: 8px;
  min-height: 330px;
}

.questions-table {
  min-width: 820px;
}

.outline-number {
  min-width: 42px;
}

.outline-text {
  font-weight: 750;
}

.tooltip-chip {
  width: 24px;
  height: 24px;
}

.dialog-actions {
  padding: 12px 22px 16px;
}

.json-preview {
  margin: 10px 22px 0;
  border-radius: 8px;
}

@media (max-width: 1500px) {
  .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px 10px;
  }

  .dashboard-view,
  .run-view,
  .content-card,
  .summary-card,
  .kpi-grid,
  .dashboard-grid {
    margin-left: 14px;
    margin-right: 14px;
  }

  .content-card {
    padding: 14px;
  }

  .plans-panel {
    padding: 0;
  }

  .topbar {
    min-height: 56px;
    padding: 8px 16px;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-card {
    padding: 13px 15px;
  }

  .summary-block strong {
    font-size: 20px;
  }

  .plan-row {
    padding: 10px;
  }

  .builder-grid {
    grid-template-columns: minmax(190px, 235px) minmax(0, 1fr);
  }

  .form-grid.three {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 1100px) {
  .search-panel,
  .summary-card,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .search-help {
    border-top: 1px solid var(--line);
  }

  .summary-block {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 12px;
  }

  .summary-block:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

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

  .top-actions {
    justify-content: flex-start;
  }

  .dashboard-view,
  .run-view,
  .content-card,
  .summary-card,
  .kpi-grid,
  .dashboard-grid {
    margin-left: 12px;
    margin-right: 12px;
  }

  .kpi-grid,
  .my-inspection-kpis,
  .builder-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "plans"
      "questions"
      "editor";
  }

  .my-inspection-row,
  .plan-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .form-grid.two,
  .form-grid.three,
  .logic-line,
  .logic-line.condition-line,
  .value-row {
    grid-template-columns: 1fr;
  }

  .dialog-progress {
    grid-template-columns: 1fr;
  }

  .dialog-actions,
  .editor-actions {
    flex-direction: column;
  }
}

/* Logic Builder should behave like a tool surface, not a long document. */
#logicBuilderView.content-card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 88px);
  min-height: 620px;
  overflow: hidden;
}

#logicBuilderView > .section-header {
  flex: 0 0 auto;
}

#logicBuilderView .builder-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(300px, 1fr) minmax(320px, 390px);
  grid-template-areas: "plans questions editor";
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
}

#logicBuilderView .builder-list,
#logicBuilderView .builder-question-panel,
#logicBuilderView .rule-editor {
  min-height: 0;
  overflow: hidden;
}

#logicBuilderView .builder-list,
#logicBuilderView .builder-question-panel {
  display: flex;
  flex-direction: column;
}

#logicBuilderView .rule-list,
#logicBuilderView .rule-question-list,
#logicBuilderView .rule-editor {
  overflow: auto;
}

#logicBuilderView .rule-list,
#logicBuilderView .rule-question-list {
  min-height: 0;
  padding-right: 2px;
}

#logicBuilderView .rule-editor {
  align-content: start;
  max-height: 100%;
}

.rule-editor-header {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -12px -12px 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: #132033;
  font-size: 13px;
  font-weight: 900;
}

#logicBuilderView .rule-editor .form-grid.two,
#logicBuilderView .rule-editor .form-grid.three {
  grid-template-columns: 1fr;
}

#logicBuilderView .rule-body {
  min-width: 0;
  line-height: 1.25;
}

#logicBuilderView .rule-body strong,
#logicBuilderView .rule-body small,
#logicBuilderView .rule-body span {
  overflow: hidden;
  text-overflow: ellipsis;
}

#logicBuilderView .builder-card {
  padding: 10px;
}

#logicBuilderView .logic-line,
#logicBuilderView .logic-line.condition-line,
#logicBuilderView .value-row {
  grid-template-columns: 1fr;
}

#logicBuilderView .editor-actions {
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 34%);
}

@media (max-width: 1180px) and (min-width: 961px) {
  #logicBuilderView .builder-grid {
    grid-template-columns: minmax(170px, 210px) minmax(260px, 1fr) minmax(300px, 340px);
  }
}

@media (max-width: 960px) {
  #logicBuilderView.content-card {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  #logicBuilderView .builder-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "plans"
      "questions"
      "editor";
    overflow: visible;
  }

  #logicBuilderView .builder-list,
  #logicBuilderView .builder-question-panel,
  #logicBuilderView .rule-editor {
    max-height: none;
    overflow: visible;
  }
}

/* Final Logic Builder formatting pass: readable rows + visible editor column. */
@media (min-width: 961px) {
  #logicBuilderView.content-card {
    height: calc(100vh - 86px);
    min-height: 680px;
    overflow: hidden;
  }

  #logicBuilderView .builder-grid {
    grid-template-columns: minmax(230px, 270px) minmax(430px, 1fr) minmax(330px, 380px);
    grid-template-areas: "plans questions editor";
    overflow-x: auto;
    overflow-y: hidden;
  }

  #logicBuilderView .builder-list,
  #logicBuilderView .builder-question-panel,
  #logicBuilderView .rule-editor {
    min-width: 0;
    max-height: 100%;
    overflow: hidden;
  }

  #logicBuilderView .rule-list,
  #logicBuilderView .rule-question-list,
  #logicBuilderView .rule-editor {
    overflow-y: auto;
    overflow-x: hidden;
  }

  #logicBuilderView .plan-group-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 56px;
    padding: 10px 12px;
    line-height: 1.2;
  }

  #logicBuilderView .plan-card-title {
    display: block;
    font-size: 14px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #logicBuilderView .plan-card-meta {
    display: block;
    margin-top: 0;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #logicBuilderView .rule-item {
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    min-height: 48px;
    padding: 8px 10px;
    line-height: 1.2;
  }

  #logicBuilderView .rule-number {
    width: 48px;
    height: 34px;
    align-self: center;
  }

  #logicBuilderView .rule-body {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    white-space: nowrap;
  }

  #logicBuilderView .rule-body strong {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    line-height: 1.2;
  }

  #logicBuilderView .rule-body small {
    flex: 0 0 auto;
    margin-top: 0;
    font-size: 11px;
    line-height: 1.2;
    color: var(--muted);
  }

  #logicBuilderView .rule-body span {
    display: none;
  }

  #logicBuilderView .rule-editor {
    display: grid;
    align-content: start;
  }
}

@media (min-width: 961px) and (max-width: 1280px) {
  #logicBuilderView .builder-grid {
    grid-template-columns: minmax(200px, 230px) minmax(380px, 1fr) minmax(300px, 330px);
  }
}

#logicBuilderView .imported-rule-card {
  display: grid;
  gap: 10px;
}

#logicBuilderView .imported-rule-card .builder-card-header {
  align-items: flex-start;
}

#logicBuilderView .imported-rule-card .builder-help {
  margin: 3px 0 0;
}

#logicBuilderView .source-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #0756a8;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* ========================================================================== 
   Enterprise UI refresh — v36
   A flatter, denser visual system designed for daily operational use.
   ========================================================================== */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --ink: #182230;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
  --nav: #101828;
  --nav-2: #101828;
  --nav-3: #1d2939;
  --blue-50: #eff8ff;
  --blue-100: #d1e9ff;
  --blue-500: #1570ef;
  --blue-700: #175cd3;
  --green-50: #ecfdf3;
  --green-700: #027a48;
  --amber-50: #fffaeb;
  --amber-700: #b54708;
  --red-50: #fef3f2;
  --red-700: #b42318;
  --purple-50: #f4f3ff;
  --purple-700: #5925dc;
  --teal-50: #f0fdfa;
  --teal-700: #0f766e;
  --sidebar-width: 252px;
  --sidebar-collapsed-width: 72px;
  --content-width: 1500px;
  color-scheme: light;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button,
input,
select,
textarea {
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button {
  min-height: 38px;
  border: 1px solid #1570ef;
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  background: #1570ef;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
}

button:hover:not(:disabled) {
  filter: none;
  background: #175cd3;
  border-color: #175cd3;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(21, 112, 239, 0.18);
  outline-offset: 1px;
}

button.secondary,
.secondary,
#previewBtn,
#expandBtn,
#clearPlanFilterBtn,
#refreshMyInspectionsBtn {
  border-color: var(--line-strong);
  background: #fff;
  color: #344054;
  box-shadow: var(--shadow);
}

button.secondary:hover:not(:disabled),
.secondary:hover:not(:disabled),
#previewBtn:hover:not(:disabled),
#expandBtn:hover:not(:disabled),
#clearPlanFilterBtn:hover:not(:disabled),
#refreshMyInspectionsBtn:hover:not(:disabled) {
  border-color: #98a2b3;
  background: #f9fafb;
  color: #182230;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  color: #182230;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  font-size: 14px;
}

textarea {
  min-height: 84px;
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #84adff;
  box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.12);
}

label {
  margin-bottom: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--bg);
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 16px 12px 14px;
  background: #101828;
  border-right: 1px solid #1d2939;
  box-shadow: none;
  overflow-x: hidden;
  transition: width 180ms ease, transform 180ms ease;
}

.brand {
  min-height: 50px;
  gap: 10px;
  padding: 2px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: #fff;
  background: #1570ef;
  box-shadow: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  stroke-width: 1.9;
}

.brand-title {
  color: #f9fafb;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-subtitle {
  color: #98a2b3;
  font-size: 11px;
  white-space: nowrap;
}

.nav {
  gap: 2px;
  margin-top: 10px;
}

.nav-group {
  gap: 2px;
}

.side-label {
  margin: 17px 10px 6px;
  color: #667085;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.nav-item,
button.nav-item,
button.nav-disabled {
  position: relative;
  min-height: 40px;
  gap: 11px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #d0d5dd;
  background: transparent;
  box-shadow: none;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-icon {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  color: #98a2b3;
  stroke-width: 1.8;
}

.nav-item:hover:not(.nav-disabled) {
  border-color: transparent;
  background: #1d2939;
  color: #f9fafb;
}

.nav-item:hover:not(.nav-disabled) .nav-icon {
  color: #d0d5dd;
}

.nav-item.active,
.nav-parent.active {
  border-color: rgba(255, 255, 255, 0.04);
  color: #fff;
  background: #175cd3;
  box-shadow: none;
}

.nav-item.active .nav-icon {
  color: #fff;
}

.nav-disabled,
button.nav-disabled {
  border-color: transparent;
  color: #667085;
  background: transparent;
  opacity: 0.58;
}

.nav-disabled .nav-icon {
  color: #667085;
}

.nav-caret {
  width: 16px !important;
  transform: rotate(90deg);
  color: #98a2b3;
  font-size: 16px;
  line-height: 1;
}

.nav-children {
  gap: 1px;
  margin: 2px 0 4px 19px;
  padding: 0 0 0 10px;
  border-left: 1px solid #344054;
}

.nav-child,
button.nav-child {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 13px;
}

.nav-child .nav-icon {
  width: 17px;
  height: 17px;
}

.user-card {
  min-height: 57px;
  margin-top: auto;
  padding: 12px 7px 0;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: #fff;
  background: #344054;
  border: 1px solid #475467;
  font-size: 12px;
  font-weight: 700;
}

.avatar.small {
  width: 30px;
  height: 30px;
  color: #344054;
  background: #f2f4f7;
  border-color: var(--line);
}

.user-card strong {
  color: #eaecf0;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.user-card small {
  color: #667085;
  font-size: 11px;
  white-space: nowrap;
}

.workspace {
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  min-height: 72px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.top-title {
  gap: 14px;
}

.top-title h1 {
  color: #182230;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.top-title p {
  margin-top: 1px;
  color: #667085;
  font-size: 12.5px;
}

.icon-button,
.round-button {
  position: relative;
  width: 36px;
  min-height: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #475467;
  background: #fff;
  box-shadow: var(--shadow);
}

.icon-button:hover:not(:disabled),
.round-button:hover:not(:disabled) {
  border-color: #d0d5dd;
  color: #182230;
  background: #f9fafb;
}

.icon-button svg,
.round-button svg {
  width: 18px;
  height: 18px;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: #f04438;
}

.company-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #475467;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.company-status-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 3px #ecfdf3;
}

.top-actions {
  gap: 8px;
}

.top-user {
  gap: 7px;
  margin-left: 2px;
  color: #344054;
  font-size: 12.5px;
  font-weight: 600;
}

.dashboard-view,
.run-view,
#myInspectionsView,
#logicBuilderView {
  width: min(calc(100% - 48px), var(--content-width));
  margin: 24px auto 40px;
}

.run-view {
  gap: 16px;
}

.run-view::before {
  display: none;
}

.run-view .summary-card,
.run-view .content-card {
  width: auto;
  margin: 0;
}

.dashboard-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  margin-bottom: 16px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.workspace-status {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.workspace-status-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #027a48;
  background: #ecfdf3;
}

.workspace-status-icon svg {
  width: 18px;
  height: 18px;
}

.workspace-status strong,
.workspace-status span {
  display: block;
}

.workspace-status strong {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.workspace-status div > span {
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
}

.command-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.command-action svg {
  width: 17px;
  height: 17px;
}

.dashboard-empty-slot > .empty-state-card,
.empty-state-card {
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid #b2ddff;
  border-radius: 10px;
  color: #1849a9;
  background: #eff8ff;
  box-shadow: none;
}

.empty-state-card strong {
  margin-bottom: 3px;
  color: inherit;
  font-size: 15px;
}

.empty-state-card p {
  color: #175cd3;
  font-size: 13px;
}

.search-panel,
.summary-card,
.content-card,
.dash-card,
.kpi-card,
.builder-list,
.builder-question-panel,
.rule-editor,
.builder-card,
.my-inspection-row,
.plan-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.kpi-card {
  min-height: 134px;
  padding: 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.kpi-card:last-child {
  border-right: 0;
}

.kpi-card span {
  margin-top: 12px;
  color: #667085;
  font-size: 12px;
  font-weight: 550;
}

.kpi-card strong {
  margin-top: 4px;
  color: #182230;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.kpi-card small {
  margin-top: 3px;
  color: #98a2b3;
  font-size: 10.5px;
  line-height: 1.35;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.kpi-icon svg {
  width: 17px;
  height: 17px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 16px;
  margin: 16px 0 0;
}

.dash-card {
  padding: 18px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.dash-card.wide {
  grid-column: auto;
  grid-row: span 2;
}

.dash-card-header {
  min-height: 34px;
}

.dash-card-header h3,
.section-header h2,
.builder-card-header h3 {
  color: #182230;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.dash-card-header .muted,
.section-header p,
.builder-help,
.muted {
  font-size: 12px;
}

.table-shell {
  margin-top: 12px;
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.mini-table th,
.mini-table td,
.questions-table th,
.questions-table td {
  padding: 11px 13px;
  border-bottom-color: #eaecf0;
}

.mini-table th,
.questions-table th {
  color: #475467;
  background: #f9fafb;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mini-table td,
.questions-table td {
  color: #344054;
  font-size: 12.5px;
}

.mini-table tbody tr:hover,
.questions-table tbody tr:hover {
  background: #fcfcfd;
}

.search-panel {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.job-search-card {
  padding: 22px 24px;
  border-right-color: var(--line);
  background: #fff;
}

.job-search-card label {
  margin-bottom: 8px;
  color: #344054;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.job-search {
  gap: 8px;
  padding: 4px;
  border-color: var(--line-strong);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.job-search:focus-within {
  border-color: #84adff;
  box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.12);
}

.job-search input {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 15px;
}

.job-search button {
  min-width: 112px;
  border-radius: 7px;
}

.search-help {
  gap: 12px;
  padding: 22px 24px;
  color: #667085;
  background: #f9fafb;
}

.search-help-icon {
  width: 38px;
  height: 38px;
  border: 1px solid #b2ddff;
  border-radius: 8px;
  color: #175cd3;
  background: #eff8ff;
}

.search-help-icon svg {
  width: 20px;
  height: 20px;
}

.search-help strong {
  margin-bottom: 2px;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.search-help p {
  font-size: 12px;
  line-height: 1.45;
}

.status,
.job-search-card .status {
  min-height: 18px;
  margin-top: 7px;
  font-size: 12px;
}

.summary-card {
  grid-template-columns: 1.3fr 0.85fr 1fr;
  gap: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
}

.summary-block {
  min-height: 118px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.summary-block .label {
  color: #667085;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.summary-block strong {
  margin: 8px 0 10px;
  font-size: 22px;
  font-weight: 700;
}

.summary-block p,
.mini-grid span {
  color: #98a2b3;
  font-size: 11px;
}

.summary-block b,
.mini-grid b {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.plans-panel {
  border-color: var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.plans-panel .section-header {
  min-height: 76px;
  padding: 16px 18px;
  border-bottom-color: var(--line);
  background: #fff;
}

.plans-panel .section-header h2 {
  margin-top: 3px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.section-kicker {
  color: #175cd3;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.plan-toolbar {
  padding: 3px;
  border-color: var(--line);
  border-radius: 9px;
  background: #f9fafb;
  box-shadow: none;
}

.plan-toolbar input {
  min-width: 220px;
  min-height: 36px;
  padding: 7px 9px;
}

.plan-toolbar button {
  min-height: 34px;
}

.plans-grid {
  gap: 0;
  padding: 0;
}

.plans-grid.empty-state {
  min-height: 250px;
  padding: 24px;
}

.plans-grid.empty-state .empty-state-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px;
  border: 1px dashed #d0d5dd;
  border-radius: 10px;
  color: #344054;
  background: #fcfcfd;
  box-shadow: none;
}

.plans-grid.empty-state .empty-state-card::before {
  display: none;
}

.plans-grid.empty-state .empty-state-card strong {
  color: #344054;
  font-size: 15px;
}

.plans-grid.empty-state .empty-state-card p {
  color: #667085;
}

.plan-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 82px;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  transform: none;
}

.plan-row:last-child {
  border-bottom: 0;
}

.plan-row:hover {
  border-color: var(--line);
  background: #f9fafb;
  box-shadow: none;
  transform: none;
}

.plan-icon {
  width: 38px;
  height: 38px;
  border-color: #b2ddff;
  border-radius: 8px;
  color: #175cd3;
  background: #eff8ff;
  font-size: 14px;
}

.plan-title-line strong {
  color: #182230;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
}

.plan-content .muted {
  margin-top: 5px;
  color: #667085;
  font-size: 12px;
}

.plan-row > button {
  min-width: 108px;
  border-radius: 7px;
}

.status-chip,
.status-badge,
.required-pill,
.badge,
.pill {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
}

.badge {
  margin-right: 5px;
}

#myInspectionsView,
#logicBuilderView {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#myInspectionsView > .section-header,
#logicBuilderView > .section-header {
  min-height: 66px;
  margin-bottom: 14px;
  padding: 0;
}

#myInspectionsView > .section-header h2,
#logicBuilderView > .section-header h2 {
  font-size: 18px;
}

#myInspectionsView > .section-header p,
#logicBuilderView > .section-header p {
  margin: 3px 0 0;
}

.toolbar {
  gap: 8px;
}

.toolbar input {
  min-width: 220px;
}

.my-inspection-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.my-inspection-kpis article {
  min-height: 88px;
  padding: 16px 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.my-inspection-kpis article:last-child {
  border-right: 0;
}

.my-inspection-kpis span {
  color: #667085;
  font-size: 11px;
  font-weight: 550;
}

.my-inspection-kpis strong {
  margin-top: 5px;
  color: #182230;
  font-size: 24px;
  font-weight: 700;
}

.my-inspections-list {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.my-inspections-list > .empty-state-card {
  margin: 0;
  border: 0;
  border-radius: 0;
  color: #344054;
  background: #fff;
  text-align: center;
}

.my-inspections-list > .empty-state-card p {
  color: #667085;
}

.my-inspection-row {
  min-height: 92px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.my-inspection-row:last-child {
  border-bottom: 0;
}

.my-inspection-row:hover {
  background: #fcfcfd;
}

.my-inspection-status {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 13px;
}

.my-inspection-title strong {
  font-size: 14px;
  font-weight: 650;
}

.my-inspection-meta,
.my-inspection-stats span,
.my-inspection-stats small {
  font-size: 11.5px;
}

.mini-progress {
  height: 4px;
  margin-top: 9px;
  border-radius: 999px;
  background: #eaecf0;
}

.mini-progress span {
  border-radius: inherit;
  background: #1570ef;
}

#logicBuilderView.content-card {
  height: calc(100vh - 104px);
  min-height: 660px;
}

#logicBuilderView .builder-grid {
  gap: 12px;
  grid-template-columns: minmax(220px, 260px) minmax(390px, 1fr) minmax(330px, 390px);
  overflow: hidden;
}

#logicBuilderView .builder-list,
#logicBuilderView .builder-question-panel,
#logicBuilderView .rule-editor {
  border-color: var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.builder-search {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.builder-panel-header {
  min-height: 58px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.builder-panel-title span {
  color: #667085;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.builder-panel-title strong {
  margin-top: 3px;
  color: #182230;
  font-size: 13px;
  font-weight: 650;
}

.builder-panel-actions {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f9fafb;
}

.builder-panel-actions span {
  color: #667085;
  font-size: 11px;
}

.rule-list,
.rule-question-list {
  gap: 0;
  padding: 6px;
}

.plan-group-card,
.rule-item,
button.plan-group-card,
button.rule-item {
  min-height: 48px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #344054;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.plan-group-card:hover,
.rule-item:hover,
button.plan-group-card:hover,
button.rule-item:hover {
  border-color: transparent;
  color: #182230;
  background: #f2f4f7;
}

.plan-group-card.active,
.rule-item.active,
button.plan-group-card.active,
button.rule-item.active {
  border-color: #b2ddff;
  color: #1849a9;
  background: #eff8ff;
  box-shadow: none;
}

.plan-card-title,
.rule-body strong {
  font-size: 12.5px;
  font-weight: 650;
}

.plan-card-meta,
.rule-body small,
.rule-body span {
  color: #667085;
  font-size: 10.5px;
}

.rule-number {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #475467;
  background: #f9fafb;
  font-size: 10px;
  font-weight: 650;
}

.rule-editor {
  gap: 11px;
  padding: 12px;
}

.rule-editor-header {
  margin: -12px -12px 0;
  padding: 12px 14px;
  color: #344054;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
}

.builder-card {
  padding: 12px;
  border-color: var(--line);
  border-radius: 8px;
  background: #fcfcfd;
  box-shadow: none;
}

.builder-card-header {
  min-height: 32px;
}

.builder-card-header h3 {
  font-size: 12.5px;
}

.builder-help {
  margin: 3px 0 8px;
  line-height: 1.4;
}

.value-row,
.logic-line,
.logic-line.condition-line {
  gap: 7px;
}

.editor-actions {
  margin: 0 -12px -12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.source-badge,
#logicBuilderView .source-badge {
  border-color: #b2ddff;
  color: #175cd3;
  background: #eff8ff;
  font-size: 10px;
  font-weight: 650;
}

/* Inspection dialog */
dialog {
  width: min(1540px, 96vw);
  max-height: 94vh;
  border-radius: 14px;
  box-shadow: 0 24px 72px rgba(16, 24, 40, 0.28);
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.66);
  backdrop-filter: blur(2px);
}

.dialog-shell {
  height: min(92vh, 980px);
  border-radius: 14px;
  background: #fff;
}

.dialog-header {
  padding: 18px 22px 16px;
  border-bottom-color: var(--line);
  background: #fff;
}

.eyebrow {
  margin-bottom: 4px;
  color: #175cd3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.dialog-header h2 {
  margin-bottom: 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.close-btn {
  width: 38px;
  min-height: 38px;
  height: 38px;
  border-color: var(--line);
  border-radius: 8px;
  color: #475467;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 23px;
}

.dialog-progress {
  gap: 0;
  padding: 0;
  border-bottom-color: var(--line);
  background: #f9fafb;
}

.dialog-progress div {
  padding: 12px 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dialog-progress div:last-child {
  border-right: 0;
}

.dialog-progress span {
  color: #667085;
  font-size: 9.5px;
  font-weight: 650;
}

.dialog-progress strong {
  margin-top: 2px;
  font-size: 19px;
  font-weight: 700;
}

.dialog-status {
  margin: 10px 22px 0;
  padding: 6px 9px;
  border-color: #b2ddff;
  border-radius: 7px;
  background: #eff8ff;
  font-size: 11px;
}

.question-tools {
  padding: 12px 22px 9px;
}

.question-search-wrap {
  max-width: 380px;
}

.question-search-wrap > svg {
  position: absolute;
  z-index: 1;
  left: 11px;
  top: 10px;
  width: 17px;
  height: 17px;
  color: #667085;
}

.question-search-wrap input {
  padding-left: 35px;
}

.questions-table-wrap {
  min-height: 330px;
  margin: 0 22px;
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.questions-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.question-row.is-valid {
  background: rgba(236, 253, 243, 0.4);
}

.question-row.is-invalid {
  background: rgba(254, 243, 242, 0.55);
}

.outline-number {
  color: #175cd3;
  font-weight: 700;
}

.outline-text {
  color: #344054;
  font-weight: 600;
}

.tooltip-chip {
  width: 26px;
  min-height: 26px;
  height: 26px;
  border-radius: 6px;
  box-shadow: none;
}

.dialog-actions {
  padding: 14px 22px;
  border-top-color: var(--line);
  background: #fff;
}

.json-preview {
  border-radius: 8px;
  background: #101828;
}

/* Collapsed desktop navigation */
body.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body.sidebar-collapsed .brand > div:last-child,
body.sidebar-collapsed .side-label,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-caret,
body.sidebar-collapsed .nav-children,
body.sidebar-collapsed .user-card-copy,
body.sidebar-collapsed .sidebar-signout {
  display: none;
}

body.sidebar-collapsed .nav-item,
body.sidebar-collapsed button.nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body.sidebar-collapsed .nav-icon {
  margin: 0;
}

body.sidebar-collapsed .user-card {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

/* Responsive layout */
@media (max-width: 1320px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi-card:nth-child(3) {
    border-right: 0;
  }

  .kpi-card:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(310px, 0.8fr);
  }

  #logicBuilderView .builder-grid {
    grid-template-columns: minmax(200px, 230px) minmax(360px, 1fr) minmax(310px, 350px);
  }
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dash-card.wide {
    grid-row: auto;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .job-search-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #logicBuilderView.content-card {
    height: auto;
    min-height: 0;
  }

  #logicBuilderView .builder-grid {
    grid-template-columns: minmax(210px, 0.7fr) minmax(420px, 1.3fr);
    grid-template-areas:
      "plans questions"
      "editor editor";
    overflow: visible;
  }

  #logicBuilderView .builder-list {
    grid-area: plans;
    min-height: 540px;
  }

  #logicBuilderView .builder-question-panel {
    grid-area: questions;
    min-height: 540px;
  }

  #logicBuilderView .rule-editor {
    grid-area: editor;
    max-height: none;
  }
}

@media (max-width: 960px) {
  .app-shell,
  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(292px, 86vw);
    height: 100dvh;
    transform: translateX(-102%);
    box-shadow: 18px 0 48px rgba(16, 24, 40, 0.24);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .brand {
    justify-content: flex-start;
    padding-left: 8px;
    padding-right: 8px;
  }

  body.sidebar-collapsed .brand > div:last-child,
  body.sidebar-collapsed .side-label,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-caret,
  body.sidebar-collapsed .user-card-copy {
    display: block;
  }

  body.sidebar-collapsed .sidebar-signout {
    display: grid;
  }

  body.sidebar-collapsed .nav-children {
    display: grid;
  }

  body.sidebar-collapsed .nav-item,
  body.sidebar-collapsed button.nav-item {
    justify-content: flex-start;
    padding-left: 10px;
    padding-right: 10px;
  }

  body.sidebar-collapsed .user-card {
    justify-content: flex-start;
    padding-left: 7px;
    padding-right: 7px;
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    z-index: 40;
    inset: 0;
    background: rgba(16, 24, 40, 0.48);
  }

  .topbar {
    padding: 0 16px;
  }

  .dashboard-view,
  .run-view,
  #myInspectionsView,
  #logicBuilderView {
    width: min(calc(100% - 32px), var(--content-width));
    margin-top: 16px;
  }

  .top-user span:last-child,
  .company-pill {
    display: none;
  }

  .summary-card {
    grid-template-columns: 1fr;
  }

  .summary-block {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-block:last-child {
    border-bottom: 0;
  }

  #logicBuilderView .builder-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "plans"
      "questions"
      "editor";
  }

  #logicBuilderView .builder-list,
  #logicBuilderView .builder-question-panel {
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 64px;
  }

  .top-title p {
    display: none;
  }

  .top-title h1 {
    font-size: 17px;
  }

  .round-button#helpButton {
    display: none;
  }

  .dashboard-commandbar {
    align-items: flex-start;
  }

  .workspace-status div > span {
    display: none;
  }

  .command-action span {
    display: none;
  }

  .command-action {
    width: 38px;
    min-width: 38px;
    padding: 0;
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card,
  .kpi-card:nth-child(3),
  .kpi-card:last-child {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .kpi-card:nth-child(even) {
    border-right: 0;
  }

  .kpi-card:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .section-header,
  #myInspectionsView > .section-header,
  #logicBuilderView > .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .plan-toolbar {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar input,
  .toolbar select,
  .plan-toolbar input {
    min-width: 0;
    flex: 1 1 180px;
  }

  .my-inspection-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .my-inspection-kpis article:nth-child(2) {
    border-right: 0;
  }

  .my-inspection-kpis article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .my-inspection-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .my-inspection-stats,
  .my-inspection-actions {
    grid-column: 2;
  }

  .my-inspection-actions {
    justify-content: flex-start;
  }

  .dialog-progress {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .dialog-progress div {
    padding: 10px 12px;
  }

  .question-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .question-search-wrap {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .dashboard-view,
  .run-view,
  #myInspectionsView,
  #logicBuilderView {
    width: min(calc(100% - 20px), var(--content-width));
    margin-bottom: 24px;
  }

  .topbar {
    padding: 0 10px;
  }

  .top-actions {
    gap: 5px;
  }

  .dashboard-commandbar {
    margin-bottom: 10px;
  }

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

  .kpi-card,
  .kpi-card:nth-child(3),
  .kpi-card:nth-child(even),
  .kpi-card:last-child {
    min-height: 112px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .kpi-card:last-child {
    border-bottom: 0;
  }

  .job-search {
    grid-template-columns: 1fr;
  }

  .job-search button {
    width: 100%;
  }

  .search-help {
    align-items: flex-start;
  }

  .plan-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .plan-row > button {
    grid-column: 2;
    justify-self: start;
  }

  .my-inspection-kpis {
    grid-template-columns: 1fr;
  }

  .my-inspection-kpis article,
  .my-inspection-kpis article:nth-child(2),
  .my-inspection-kpis article:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .my-inspection-kpis article:last-child {
    border-bottom: 0;
  }

  .dialog-header,
  .question-tools,
  .dialog-actions {
    padding-left: 14px;
    padding-right: 14px;
  }

  .questions-table-wrap {
    margin-left: 14px;
    margin-right: 14px;
  }

  .dialog-actions {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.plan-icon svg,
.my-inspection-status svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 960px) {
  .topbar {
    flex-direction: row;
    align-items: center;
  }

  .top-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .top-title,
  .top-title > div {
    min-width: 0;
  }

  .top-title h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

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

  .kpi-card,
  .kpi-card:nth-child(3),
  .kpi-card:nth-child(even),
  .kpi-card:last-child {
    min-height: 132px;
    padding: 15px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .kpi-card:nth-child(even) {
    border-right: 0;
  }

  .kpi-card:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .kpi-card small {
    font-size: 10px;
  }

  .my-inspection-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .my-inspection-kpis article,
  .my-inspection-kpis article:nth-child(2),
  .my-inspection-kpis article:last-child {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .my-inspection-kpis article:nth-child(even) {
    border-right: 0;
  }

  .my-inspection-kpis article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}


/* v36.1: keep question settings controls anchored while the editor body scrolls. */
#logicBuilderView .rule-editor {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

#logicBuilderView .rule-editor-header {
  position: relative;
  top: auto;
  z-index: 3;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

#logicBuilderView .rule-editor-scroll {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  gap: 11px;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#logicBuilderView .rule-editor-scroll > .editor-actions {
  margin: 0 -12px -12px;
}

#logicBuilderView > .section-header .toolbar {
  align-items: center;
}

@media (max-width: 1200px) {
  #logicBuilderView .rule-editor {
    overflow: visible;
  }

  #logicBuilderView .rule-editor-scroll {
    overflow: visible;
  }
}

/* v36.2: supervisor oversight and direct inspection resume actions. */
.dialog-status:empty {
  display: none;
}

.dashboard-record-row {
  cursor: pointer;
  outline: none;
}

.dashboard-record-row:hover {
  background: #f8fafc !important;
}

.dashboard-record-row:focus-visible {
  background: #eff8ff !important;
  box-shadow: inset 3px 0 0 #1570ef;
}

.dashboard-record-row td:last-child {
  white-space: nowrap;
}

.dashboard-record-updated {
  vertical-align: middle;
}

.dashboard-row-arrow {
  width: 15px;
  height: 15px;
  margin-left: 8px;
  color: #98a2b3;
  vertical-align: middle;
  transition: transform 140ms ease, color 140ms ease;
}

.dashboard-record-row:hover .dashboard-row-arrow,
.dashboard-record-row:focus-visible .dashboard-row-arrow {
  color: #1570ef;
  transform: translateX(2px);
}

.supervisor-view {
  width: min(calc(100% - 48px), var(--content-width));
  margin: 24px auto 40px;
}

.supervisor-header {
  min-height: 66px;
  margin-bottom: 14px;
  padding: 0;
}

.supervisor-header h2 {
  margin-top: 3px;
  color: #182230;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.supervisor-header p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
}

.supervisor-toolbar {
  align-items: center;
}

.supervisor-search-wrap {
  position: relative;
  min-width: min(340px, 40vw);
}

.supervisor-search-wrap svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  width: 16px;
  height: 16px;
  color: #667085;
  transform: translateY(-50%);
  pointer-events: none;
}

.supervisor-search-wrap input {
  width: 100%;
  min-width: 0;
  padding-left: 34px;
}

.supervisor-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.supervisor-kpis article {
  min-height: 88px;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.supervisor-kpis article:last-child {
  border-right: 0;
}

.supervisor-kpis span,
.supervisor-kpis strong {
  display: block;
}

.supervisor-kpis span {
  color: #667085;
  font-size: 11px;
  font-weight: 550;
}

.supervisor-kpis strong {
  margin-top: 5px;
  color: #182230;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.supervisor-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

.supervisor-card-header h3 {
  margin: 0;
  color: #182230;
  font-size: 15px;
  font-weight: 650;
}

.supervisor-card-header p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
}

.source-badge.is-local {
  border-color: #fedf89;
  color: #b54708;
  background: #fffaeb;
}

.supervisor-table-shell {
  overflow-x: auto;
}

.supervisor-table {
  min-width: 990px;
}

.supervisor-table th:last-child,
.supervisor-table td:last-child {
  width: 74px;
  text-align: right;
}

.supervisor-submission-row {
  cursor: pointer;
  outline: none;
}

.supervisor-submission-row:hover {
  background: #f8fafc !important;
}

.supervisor-submission-row:focus-visible {
  background: #eff8ff !important;
  box-shadow: inset 3px 0 0 #1570ef;
}

.supervisor-inspector {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 170px;
}

.supervisor-inspector > span:last-child,
.supervisor-inspector strong,
.supervisor-inspector small {
  display: block;
}

.supervisor-inspector strong {
  color: #344054;
  font-size: 12.5px;
  font-weight: 650;
}

.supervisor-inspector small {
  max-width: 190px;
  margin-top: 2px;
  color: #667085;
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar.supervisor-avatar {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid #b2ddff;
  color: #175cd3;
  background: #eff8ff;
  font-size: 11px;
}

.supervisor-action-cell button {
  min-width: 58px;
}

.supervisor-empty-cell {
  height: 180px;
  text-align: center;
}

@media (max-width: 960px) {
  .supervisor-view {
    width: auto;
    margin: 18px 16px 32px;
  }

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

  .supervisor-toolbar,
  .supervisor-search-wrap {
    width: 100%;
    min-width: 0;
  }

  .supervisor-search-wrap {
    flex: 1 1 100%;
  }
}

@media (max-width: 640px) {
  .supervisor-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .supervisor-kpis article,
  .supervisor-kpis article:last-child {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .supervisor-kpis article:nth-child(even) {
    border-right: 0;
  }

  .supervisor-kpis article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .supervisor-card {
    padding: 14px;
  }

  .supervisor-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v36.4 date and date/time quick-fill control */
.date-answer-group {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.date-answer-group .answer-control {
  flex: 1 1 180px;
  min-width: 0;
}

.today-date-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #b2ccff;
  border-radius: 8px;
  background: #eff4ff;
  color: #1849a9;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.today-date-button:hover:not(:disabled) {
  border-color: #84adff;
  background: #d1e0ff;
  color: #173f8a;
}

.today-date-button:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.22);
  outline-offset: 2px;
}

.today-date-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 720px) {
  .date-answer-group {
    align-items: stretch;
    flex-direction: column;
  }

  .today-date-button {
    width: 100%;
  }
}

/* Microsoft Entra authentication */
.login-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 32px;
  color: #f8fbff;
  background: #071220;
}

.login-backdrop,
.login-grid,
.login-orb {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-backdrop {
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 12%, rgba(35, 119, 230, 0.22), transparent 34%),
    radial-gradient(circle at 84% 80%, rgba(36, 174, 154, 0.16), transparent 30%),
    linear-gradient(135deg, #06101c 0%, #0a1b30 56%, #071522 100%);
}

.login-grid {
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 92%);
}

.login-orb {
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(18px);
}

.login-orb-one {
  inset: -180px auto auto -130px;
  background: rgba(13, 99, 205, 0.18);
}

.login-orb-two {
  inset: auto -190px -220px auto;
  background: rgba(20, 161, 142, 0.14);
}

.login-layout {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: clamp(48px, 8vw, 112px);
  align-items: center;
}

.login-brand-panel {
  min-width: 0;
  padding: clamp(8px, 2vw, 28px);
}

.login-brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #2384ed, #0b58bd);
  box-shadow: 0 18px 50px rgba(0, 82, 180, 0.35);
}

.login-brand-mark svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-product,
.login-suite {
  display: block;
}

.login-product {
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.login-suite {
  margin-top: 3px;
  color: #9fb4cc;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.login-hero-copy {
  max-width: 700px;
  margin-top: clamp(64px, 10vh, 116px);
}

.login-eyebrow,
.login-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 800;
}

.login-eyebrow {
  color: #74b8ff;
}

.login-hero-copy h1 {
  margin: 18px 0 18px;
  max-width: 680px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  color: #fff;
}

.login-hero-copy p {
  max-width: 640px;
  margin: 0;
  color: #afc1d4;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.7;
}

.login-trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(54px, 8vh, 90px);
}

.login-trust-row > div {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}

.login-trust-row svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  color: #69aef8;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-trust-row span,
.login-trust-row strong,
.login-trust-row small {
  display: block;
}

.login-trust-row strong {
  color: #edf5ff;
  font-size: 13px;
}

.login-trust-row small {
  margin-top: 4px;
  color: #8399b1;
  font-size: 11px;
  line-height: 1.45;
}

.login-card-wrap {
  width: 100%;
  max-width: 430px;
  justify-self: end;
}

.login-card {
  padding: clamp(30px, 4vw, 46px);
  color: #162033;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
}

.login-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: #0b63ce;
  border: 1px solid #d7e7fa;
  border-radius: 14px;
  background: #edf6ff;
}

.login-card-icon svg,
.login-security-note svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-card-kicker {
  color: #52708f;
}

.login-card h2 {
  margin: 10px 0 8px;
  color: #101828;
  font-size: 30px;
  letter-spacing: -0.035em;
}

.login-card > p {
  margin: 0 0 30px;
  color: #667085;
  font-size: 14px;
  line-height: 1.6;
}

.microsoft-signin {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 12px 18px;
  color: #1b1b1b;
  border: 1px solid #c8d0da;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.08);
  font-size: 14px;
  font-weight: 700;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.microsoft-signin:hover {
  filter: none;
  border-color: #93a3b7;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.12);
  transform: translateY(-1px);
}

.microsoft-signin:focus-visible {
  outline: 3px solid rgba(11, 99, 206, 0.24);
  outline-offset: 3px;
}

.microsoft-logo {
  width: 20px;
  height: 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  flex: 0 0 auto;
}

.microsoft-logo i:nth-child(1) { background: #f25022; }
.microsoft-logo i:nth-child(2) { background: #7fba00; }
.microsoft-logo i:nth-child(3) { background: #00a4ef; }
.microsoft-logo i:nth-child(4) { background: #ffb900; }

.login-status {
  min-height: 22px;
  margin-top: 14px;
  color: #b42318;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.login-status.is-loading {
  color: #475467;
}

.login-security-note {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  color: #667085;
  border-top: 1px solid #e7ebf0;
  font-size: 11px;
  line-height: 1.55;
}

.login-security-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #027a48;
}

.login-footer {
  margin: 18px 0 0;
  color: #7f94aa;
  font-size: 11px;
  text-align: center;
}

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

.user-card-copy strong,
.user-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-signout {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  color: #b8c9dd;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.sidebar-signout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  filter: none;
}

.sidebar-signout svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.authenticated .login-screen {
  display: none;
}

body.authenticated .app-shell {
  display: grid !important;
}

@media (max-width: 900px) {
  .login-screen {
    padding: 24px;
  }

  .login-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .login-brand-panel {
    padding: 0;
  }

  .login-hero-copy {
    margin-top: 52px;
  }

  .login-hero-copy h1 {
    max-width: 760px;
  }

  .login-card-wrap {
    max-width: 520px;
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .login-screen {
    align-items: start;
    padding: 22px 16px 30px;
  }

  .login-layout {
    gap: 32px;
  }

  .login-hero-copy {
    margin-top: 42px;
  }

  .login-hero-copy h1 {
    font-size: 38px;
  }

  .login-trust-row {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 36px;
  }

  .login-card {
    padding: 28px 24px;
    border-radius: 18px;
  }
}


/* v36.10: inspection dialog layout cleanup */
#planDialog .dialog-shell {
  overflow: hidden;
}

#planDialog .dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding-bottom: 16px;
}

#planDialog .dialog-header-main {
  min-width: 0;
}

#planDialog .dialog-header-side {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  min-width: max-content;
}

#planDialog .dialog-progress.dialog-progress-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(108px, 1fr));
  min-width: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}

#planDialog .dialog-progress.dialog-progress-inline div {
  padding: 10px 14px;
  border-right: 1px solid var(--line);
}

#planDialog .dialog-progress.dialog-progress-inline div:last-child {
  border-right: 0;
}

#planDialog .question-tools {
  padding-top: 10px;
  padding-bottom: 10px;
}

#planDialog .questions-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

#planDialog .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#planDialog .dialog-actions-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

#planDialog .dialog-status {
  margin: 0;
  max-width: 520px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}

#planDialog .dialog-status:empty {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
}

@media (max-width: 1080px) {
  #planDialog .dialog-header {
    grid-template-columns: 1fr;
  }

  #planDialog .dialog-header-side {
    width: 100%;
    justify-content: space-between;
  }

  #planDialog .dialog-progress.dialog-progress-inline {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 720px) {
  #planDialog .dialog-header-side {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  #planDialog .close-btn {
    align-self: flex-end;
  }

  #planDialog .dialog-progress.dialog-progress-inline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #planDialog .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #planDialog .dialog-actions-buttons {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  #planDialog .dialog-status {
    max-width: none;
    width: 100%;
  }
}


/* v36.11: Peak corporate branding and navigation */
:root {
  --peak-plum: #3d203f;
  --peak-plum-deep: #28162b;
  --peak-plum-soft: #5a335d;
  --peak-plum-light: #f5eff5;
  --peak-border: rgba(255, 255, 255, 0.12);
  --sidebar-width: 272px;
}

/* Peak logo placements */
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 92px;
  gap: 5px;
  padding: 12px 14px 16px;
  border-bottom: 1px solid var(--peak-border);
}

.brand-logo-full {
  display: block;
  width: 146px;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
}

.brand-logo-mark {
  display: none;
  width: 35px;
  height: 35px;
  object-fit: cover;
  border-radius: 8px;
}

.brand-product {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.login-peak-logo {
  display: block;
  width: clamp(164px, 18vw, 228px);
  height: auto;
  object-fit: contain;
  border-radius: 5px;
}

.login-brand-copy {
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.24);
}

.login-card-icon {
  overflow: hidden;
  padding: 0;
  border-color: #e9dfea;
  background: var(--peak-plum);
}

.login-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.company-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 7px;
  color: #3d203f;
  border: 1px solid #e4d8e5;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(38, 22, 43, 0.06);
}

.company-pill img {
  width: 76px;
  height: 27px;
  object-fit: cover;
  border-radius: 5px;
}

.company-pill-label {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Corporate sidebar */
.sidebar {
  padding: 0 12px 14px;
  color: #fff;
  border-right: 1px solid #563058;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 18%),
    var(--peak-plum);
  box-shadow: 10px 0 30px rgba(40, 22, 43, 0.08);
}

.nav {
  gap: 3px;
  margin-top: 8px;
  padding: 0 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.side-label {
  margin: 18px 11px 7px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.nav-item,
button.nav-item {
  min-height: 42px;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.nav-icon {
  color: rgba(255, 255, 255, 0.56);
}

.nav-item:hover:not(.nav-disabled),
button.nav-item:hover:not(.nav-disabled) {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
}

.nav-item:hover:not(.nav-disabled) .nav-icon {
  color: #fff;
}

.nav-item.active,
.nav-parent.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.82);
}

.nav-item.active .nav-icon,
.nav-parent.active .nav-icon {
  color: #fff;
}

.nav-parent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 4px;
  align-items: center;
}

.nav-parent-row .nav-parent {
  width: 100%;
}

.nav-expander {
  width: 36px;
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: rgba(255, 255, 255, 0.62);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.nav-expander:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
}

.nav-expander svg {
  width: 16px;
  height: 16px;
  transform: rotate(90deg);
  transition: transform 170ms ease;
}

.nav-group.is-collapsed .nav-expander svg {
  transform: rotate(0deg);
}

.nav-children {
  max-height: 112px;
  gap: 2px;
  margin: 4px 0 5px 22px;
  padding: 0 0 0 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  opacity: 1;
  overflow: hidden;
  transition: max-height 180ms ease, opacity 140ms ease, margin 180ms ease;
}

.nav-group.is-collapsed .nav-children {
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.nav-child,
button.nav-child {
  min-height: 37px;
  color: rgba(255, 255, 255, 0.68);
}

.admin-nav-section {
  display: block;
}

.admin-nav-section.hidden {
  display: none !important;
}

.user-card {
  gap: 9px;
  min-height: 66px;
  margin: auto 2px 0;
  padding: 11px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.user-card .avatar {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.18);
}

.sidebar-signout {
  color: rgba(255, 255, 255, 0.7);
}

/* Peak-branded login */
.login-screen {
  background: var(--peak-plum-deep);
}

.login-backdrop {
  background:
    radial-gradient(circle at 9% 12%, rgba(133, 77, 136, 0.42), transparent 34%),
    radial-gradient(circle at 86% 84%, rgba(90, 51, 93, 0.38), transparent 31%),
    linear-gradient(135deg, #221226 0%, #3d203f 58%, #28162b 100%);
}

.login-orb-one {
  background: rgba(150, 92, 153, 0.22);
}

.login-orb-two {
  background: rgba(101, 58, 105, 0.2);
}

.login-eyebrow,
.login-trust-row svg {
  color: #d9b9db;
}

.login-card-kicker {
  color: #765379;
}

.login-security-note svg {
  color: #69406c;
}

.microsoft-signin:focus-visible {
  outline-color: rgba(90, 51, 93, 0.26);
}

/* Peak accent on primary workflow actions */
.command-action,
#searchBtn,
#saveDraftBtn,
#submitInspectionBtn,
#saveRulesBtn,
#applyRuleBtn,
#newRuleBtn,
#testPlanBtn {
  border-color: var(--peak-plum);
  background: var(--peak-plum);
}

.command-action:hover:not(:disabled),
#searchBtn:hover:not(:disabled),
#saveDraftBtn:hover:not(:disabled),
#submitInspectionBtn:hover:not(:disabled),
#saveRulesBtn:hover:not(:disabled),
#applyRuleBtn:hover:not(:disabled),
#newRuleBtn:hover:not(:disabled),
#testPlanBtn:hover:not(:disabled) {
  border-color: var(--peak-plum-deep);
  background: var(--peak-plum-deep);
}

/* Collapsed desktop navigation */
body.sidebar-collapsed .brand {
  min-height: 72px;
  align-items: center;
  padding: 12px 0;
}

body.sidebar-collapsed .brand-logo-full,
body.sidebar-collapsed .brand-product,
body.sidebar-collapsed .nav-expander {
  display: none;
}

body.sidebar-collapsed .brand-logo-mark {
  display: block;
}

body.sidebar-collapsed .nav-parent-row {
  display: block;
}

body.sidebar-collapsed .nav-children {
  display: none;
}

@media (max-width: 960px) {
  .sidebar {
    width: min(292px, 88vw);
  }

  .brand-logo-full {
    width: 154px;
  }
}

@media (max-width: 720px) {
  .company-pill-label {
    display: none;
  }

  .company-pill {
    padding-right: 7px;
  }

  .login-brand-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-brand-copy {
    padding: 9px 0 0;
    border-left: 0;
  }
}

/* v36.13: access administration and role-aware navigation */
.review-nav-section,
.configuration-nav-section,
.admin-nav-section {
  display: block;
}

.review-nav-section.hidden,
.configuration-nav-section.hidden,
.admin-nav-section.hidden {
  display: none !important;
}

.sidebar-access-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 2px 7px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.company-pill.company-pill-logo-only {
  padding: 5px 7px;
}

.company-pill.company-pill-logo-only img {
  width: 84px;
}

.access-view {
  width: min(calc(100% - 48px), var(--content-width));
  margin: 24px auto 40px;
}

.access-header {
  min-height: 66px;
  margin-bottom: 14px;
  padding: 0;
}

.access-header h2 {
  margin-top: 3px;
  color: #182230;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.access-header p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
}

#addAccessUserBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: var(--peak-plum);
  background: var(--peak-plum);
}

#addAccessUserBtn:hover:not(:disabled) {
  border-color: var(--peak-plum-deep);
  background: var(--peak-plum-deep);
}

#addAccessUserBtn svg {
  width: 16px;
  height: 16px;
}

.access-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.access-kpis article {
  min-height: 88px;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.access-kpis article:last-child {
  border-right: 0;
}

.access-kpis span,
.access-kpis strong {
  display: block;
}

.access-kpis span {
  color: #667085;
  font-size: 11px;
  font-weight: 550;
}

.access-kpis strong {
  margin-top: 5px;
  color: #182230;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.access-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.access-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.access-card-header h3 {
  margin: 0;
  color: #182230;
  font-size: 15px;
  font-weight: 650;
}

.access-card-header p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
}

.access-search-wrap {
  position: relative;
  width: min(340px, 40vw);
}

.access-search-wrap svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 16px;
  height: 16px;
  color: #667085;
  transform: translateY(-50%);
  pointer-events: none;
}

.access-search-wrap input {
  width: 100%;
  padding-left: 34px;
}

.access-status {
  min-height: 20px;
  margin: 0 0 10px;
  color: #667085;
  font-size: 11px;
}

.access-status[data-kind="error"] {
  color: #b42318;
}

.access-status[data-kind="success"] {
  color: #027a48;
}

.access-table-shell {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: auto;
}

.access-table {
  min-width: 840px;
}

.access-table th:last-child,
.access-table td:last-child {
  text-align: right;
}

.access-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.access-user-cell > span:last-child {
  min-width: 0;
}

.access-user-cell strong,
.access-user-cell small {
  display: block;
}

.access-user-cell strong {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.access-user-cell small {
  margin-top: 2px;
  color: #667085;
  font-size: 10px;
}

.access-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--peak-plum);
  border-color: #e5d8e6;
  background: #f7f1f7;
}

.access-you-badge {
  display: inline-flex;
  margin-left: 7px;
  padding: 1px 5px;
  color: #69406c;
  border: 1px solid #e5d8e6;
  border-radius: 999px;
  background: #f8f3f8;
  font-size: 8px;
  font-style: normal;
  font-weight: 750;
  text-transform: uppercase;
}

.access-level-badge,
.access-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
}

.access-level-badge.is-inspector {
  color: #344054;
  border-color: #d0d5dd;
  background: #f9fafb;
}

.access-level-badge.is-supervisor {
  color: #175cd3;
  border-color: #b2ddff;
  background: #eff8ff;
}

.access-level-badge.is-admin {
  color: #69406c;
  border-color: #dfc9e1;
  background: #f8f3f8;
}

.access-status-badge.is-active {
  color: #027a48;
  border-color: #abefc6;
  background: #ecfdf3;
}

.access-status-badge.is-pending {
  color: #b54708;
  border-color: #fedf89;
  background: #fffaeb;
}

.access-status-badge.is-disabled {
  color: #b42318;
  border-color: #fecdca;
  background: #fef3f2;
}

.access-action-cell {
  text-align: right;
  white-space: nowrap;
}

.access-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.access-action-cell .danger {
  color: #b42318;
  border-color: #fecdca;
  background: #fff;
}

.access-action-cell .danger:hover:not(:disabled) {
  color: #912018;
  border-color: #fda29b;
  background: #fef3f2;
}

.access-empty-cell {
  padding: 34px !important;
  text-align: center;
}

.access-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(760px, 92vh);
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: transparent;
  box-shadow: 0 24px 72px rgba(16, 24, 40, 0.28);
}

.access-dialog::backdrop {
  background: rgba(16, 24, 40, 0.64);
  backdrop-filter: blur(2px);
}

.access-dialog-shell {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
}

.access-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.access-dialog-header h2 {
  margin: 3px 0 4px;
  color: #182230;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.access-dialog-header p {
  margin: 0;
  color: #667085;
  font-size: 11px;
}

.access-dialog-body {
  display: grid;
  gap: 15px;
  padding: 20px 22px;
  overflow: auto;
}

.access-dialog-body label > span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #344054;
  font-size: 11px;
  font-weight: 650;
}

.access-dialog-body label > span em {
  color: #98a2b3;
  font-size: 9px;
  font-style: normal;
  font-weight: 550;
}

.access-dialog-body label > small {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: 9px;
}

.access-level-explainer {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  color: #344054;
  border: 1px solid #e4d8e5;
  border-radius: 8px;
  background: #fbf8fb;
}

.access-level-explainer strong {
  color: var(--peak-plum);
  font-size: 11px;
}

.access-level-explainer span {
  color: #667085;
  font-size: 10px;
  line-height: 1.45;
}

.access-active-toggle {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}

.access-active-toggle input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.access-active-toggle > span {
  display: block !important;
  margin: 0 !important;
}

.access-active-toggle strong,
.access-active-toggle small {
  display: block;
}

.access-active-toggle strong {
  color: #344054;
  font-size: 11px;
}

.access-active-toggle small {
  margin-top: 2px;
  color: #667085;
  font-size: 9px;
  font-weight: 500;
}

.access-form-status {
  min-height: 18px;
  color: #b42318;
  font-size: 10px;
}

.access-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #f9fafb;
}

#saveAccessBtn {
  border-color: var(--peak-plum);
  background: var(--peak-plum);
}

#saveAccessBtn:hover:not(:disabled) {
  border-color: var(--peak-plum-deep);
  background: var(--peak-plum-deep);
}

@media (max-width: 820px) {
  .access-view {
    width: min(calc(100% - 24px), var(--content-width));
  }

  .access-header,
  .access-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .access-search-wrap {
    width: 100%;
  }

  .access-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .access-kpis article:nth-child(2) {
    border-right: 0;
  }

  .access-kpis article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .access-view {
    width: min(calc(100% - 20px), var(--content-width));
  }

  .access-kpis {
    grid-template-columns: 1fr;
  }

  .access-kpis article,
  .access-kpis article:nth-child(2),
  .access-kpis article:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .access-kpis article:last-child {
    border-bottom: 0;
  }

  .access-card {
    padding: 13px;
  }

  .access-dialog-header,
  .access-dialog-body,
  .access-dialog-actions {
    padding-left: 16px;
    padding-right: 16px;
  }
}


/* v36.14: corporate navigation, administrator-only configuration, and action contrast */
#logicBuilderView > .section-header .toolbar #newRuleBtn,
#logicBuilderView > .section-header .toolbar #testPlanBtn,
#logicBuilderView > .section-header .toolbar #saveRulesBtn {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

#logicBuilderView > .section-header .toolbar #newRuleBtn:disabled,
#logicBuilderView > .section-header .toolbar #testPlanBtn:disabled,
#logicBuilderView > .section-header .toolbar #saveRulesBtn:disabled {
  color: rgba(255, 255, 255, 0.78);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.78);
}

.sidebar .nav-item.active,
.sidebar .nav-parent.active {
  box-shadow: none;
}

.sidebar .nav-item .nav-label,
.sidebar .nav-parent .nav-parent-label {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.sidebar .nav-parent-row .nav-parent {
  padding-left: 11px;
  padding-right: 11px;
}

.sidebar .nav-item:focus:not(:focus-visible),
.sidebar .nav-expander:focus:not(:focus-visible) {
  outline: none;
}

.workspace-status > div {
  min-width: 0;
}

.workspace-status strong {
  color: #344054;
}

.workspace-status span {
  color: #667085;
}
