:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #172033;
  --muted: #687386;
  --line: #dbe2ea;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --success: #11845b;
  --danger: #c2410c;
  --warning: #b45309;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121821;
  --surface: #192231;
  --surface-2: #222e3f;
  --text: #edf2f7;
  --muted: #a7b1c2;
  --line: #324157;
  --accent: #60a5fa;
  --accent-strong: #93c5fd;
  --success: #34d399;
  --danger: #fb923c;
  --warning: #fbbf24;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  letter-spacing: 0;
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card .brand-mark {
  width: 54px;
  height: 54px;
}

.login-card h1 {
  font-size: 26px;
}

.login-card p {
  color: var(--muted);
}

.login-error {
  color: var(--danger);
  font-weight: 700;
}

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

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28), transparent 28px),
    linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 30%, transparent);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
}

.brand-mark::before {
  content: "";
  position: absolute;
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(18deg);
}

.brand-mark span {
  position: relative;
  z-index: 1;
  font-size: 13px;
  line-height: 1;
}

.brand-mark span:first-child {
  transform: translateX(3px);
}

.brand-mark span:last-child {
  transform: translateX(-3px);
}

.brand strong {
  font-size: 16px;
  color: var(--text);
}

.brand strong {
  display: block;
}

.brand > div:last-child {
  min-width: 0;
}

.brand > div:last-child span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.muted,
label span,
label small,
.switch small,
.check-item span {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.theme-toggle,
.ghost-button,
.action-button {
  position: relative;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--accent-strong);
  font-weight: 700;
}

.nav-item.active .nav-icon {
  color: var(--accent-strong);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-2);
  border-color: var(--line);
  width: 100%;
  padding: 0 12px;
}

.sidebar-controls {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.theme-control {
  display: grid;
  gap: 7px;
}

.theme-control > span {
  color: var(--muted);
}

.theme-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  color: var(--accent-strong);
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

:root[data-theme="dark"] .theme-icon {
  background: currentColor;
  box-shadow: inset -5px 0 0 var(--surface-2);
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 520px) minmax(220px, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar-title {
  min-width: 0;
}

.topbar-title p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

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

.status-feed {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, var(--surface-2));
}

.status-event {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-event::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.status-event span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-event[data-tone="ok"] {
  color: var(--success);
}

.status-event[data-tone="busy"] {
  color: var(--warning);
}

.status-event[data-tone="danger"] {
  color: var(--danger);
}

.session-user {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.status-pill,
.badge,
.table-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-pill[data-tone="ok"] {
  color: var(--success);
}

.status-pill[data-tone="busy"] {
  color: var(--warning);
}

.status-pill[data-tone="danger"] {
  color: var(--danger);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.panel,
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.form-grid,
.form-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 14px;
  align-items: end;
}

.check-form {
  display: grid;
  gap: 18px;
}

.form-section {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 46%, transparent);
}

.form-section-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.form-section-head h3 {
  margin: 0;
  font-size: 17px;
}

.form-section-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.section-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 800;
}

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

.checkbox-grid {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.check-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px 10px;
  align-content: start;
  min-height: 82px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.check-card input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin-top: 3px;
  border: 1px solid color-mix(in srgb, var(--muted) 42%, var(--line));
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}

.check-card input::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: transparent;
}

.check-card input:checked {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.check-card input:checked::after {
  background: var(--accent);
}

.check-card span {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.check-card small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.check-card:has(input:disabled) {
  opacity: 0.55;
}

.source-check-card {
  min-height: auto;
  align-self: end;
}

.form-section-grid > label:not(.check-card) > span {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.form-actions {
  display: flex;
  justify-content: center;
}

.form-actions .primary-action {
  width: min(520px, 100%);
}

label {
  display: grid;
  gap: 7px;
}

label small,
.switch small {
  font-size: 12px;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}

input[type="file"] {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  font-size: 14px;
}

input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-color: var(--accent);
}

.switch-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.switch-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.switch {
  position: relative;
  width: 46px;
  min-width: 46px;
  height: 26px;
  margin-top: 3px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease;
}

.switch input:checked + span::after {
  transform: translateX(20px);
  background: var(--accent);
}

.primary-action {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 78%, #ffffff);
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
  box-shadow:
    0 10px 22px color-mix(in srgb, var(--accent) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(0, 0, 0, 0.16);
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-action:hover:not(:disabled) {
  background: var(--accent-strong);
  filter: none;
  transform: translateY(-2px);
  box-shadow:
    0 18px 34px color-mix(in srgb, var(--accent) 34%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.primary-action::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 140ms ease, transform 180ms ease;
}

.primary-action:active:not(:disabled)::before,
.primary-action.is-pressing::before,
.primary-action[aria-busy="true"]::before {
  opacity: 1;
  transform: scale(1);
}

.primary-action:active:not(:disabled),
.primary-action.is-pressing,
.ghost-button:active:not(:disabled),
.action-button:active:not(:disabled),
.nav-item:active:not(:disabled),
.theme-toggle:active:not(:disabled),
.table-actions a:active,
.table-actions button:active:not(:disabled),
input[type="file"]::file-selector-button:active {
  transform: translateY(2px) scale(0.985);
}

.primary-action:active:not(:disabled),
.primary-action.is-pressing {
  background: color-mix(in srgb, var(--accent-strong) 82%, #000000);
  filter: none;
  border-color: color-mix(in srgb, var(--accent-strong) 75%, #000000);
  box-shadow:
    0 3px 8px color-mix(in srgb, var(--accent) 24%, transparent),
    inset 0 3px 8px rgba(0, 0, 0, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

button[aria-busy="true"],
.action-button[aria-busy="true"] {
  pointer-events: none;
  opacity: 1;
  cursor: progress;
}

.primary-action[aria-busy="true"] {
  background: color-mix(in srgb, var(--accent-strong) 88%, #000000);
  filter: none;
  transform: translateY(1px);
  box-shadow:
    0 4px 12px color-mix(in srgb, var(--accent) 26%, transparent),
    inset 0 3px 8px rgba(0, 0, 0, 0.22);
}

button[aria-busy="true"]::after,
.action-button[aria-busy="true"]::after {
  content: "";
  display: none;
}

.primary-action[aria-busy="true"]::after {
  display: block;
  position: absolute;
  left: -35%;
  right: auto;
  bottom: 0;
  width: 35%;
  height: 4px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.58);
  animation: button-progress 1050ms ease-in-out infinite;
}

@keyframes button-progress {
  0% { transform: translateX(0); }
  55% { transform: translateX(285%); }
  100% { transform: translateX(385%); }
}

.ghost-button {
  padding: 0 12px;
  border-color: var(--line);
}

.ghost-button:hover:not(:disabled),
.action-button:hover:not(:disabled),
.nav-item:hover:not(.active):not(:disabled),
.theme-toggle:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent-strong);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

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

.metric {
  padding: 16px;
}

.metric span,
.metric strong {
  display: block;
}

.metric strong {
  margin-top: 6px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.checks-list {
  display: grid;
  gap: 8px;
}

.check-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.check-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.check-item div:first-child {
  min-width: 0;
}

.check-item strong,
.check-item span {
  display: block;
  overflow-wrap: anywhere;
}

.check-item summary > div:first-child span {
  max-width: 980px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.check-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.flag-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 14%, transparent);
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
  font-size: 13px;
  font-weight: 700;
}

.check-item pre {
  display: none;
}

.check-item .answer {
  margin-top: 12px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.45;
}

.human-check-body {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.human-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.human-block h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.human-list {
  margin: 0;
  padding-left: 18px;
}

.human-list li {
  margin: 5px 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.badge[data-status="ready"],
.badge[data-status="partial"] {
  color: var(--success);
}

.badge[data-status="not_enough_data"] {
  color: var(--warning);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.table-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions a,
.table-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--accent-strong);
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.domain-list {
  min-height: 180px;
  padding: 12px;
  resize: vertical;
}

.batch-controls {
  display: grid;
  grid-template-columns: minmax(90px, 120px) minmax(140px, 180px) repeat(2, minmax(180px, 1fr)) minmax(140px, 180px);
  gap: 14px;
  align-items: end;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.bulk-bar {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(260px, 1fr) minmax(360px, 1.3fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.bulk-status {
  color: var(--muted);
  font-weight: 700;
}

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

.bulk-actions {
  justify-content: flex-end;
}

.inline-check {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.inline-check input,
.row-check {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

.select-col {
  width: 54px;
  text-align: center;
}

.bulk-bar .ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.report-viewer-empty {
  color: var(--muted);
  padding: 20px 0;
}

.inline-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.inline-link:hover {
  text-decoration: underline;
}

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

.report-metrics.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

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

.viewer-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
  margin-top: 14px;
}

.viewer-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.viewer-section ul {
  margin: 0;
  padding-left: 18px;
}

.integrations-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.integration-item {
  display: grid;
  gap: 16px;
  align-content: space-between;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.integration-item strong,
.integration-item span {
  display: block;
}

.integration-item span {
  color: var(--muted);
  font-size: 13px;
}

.integration-item code {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--accent-strong);
}

.settings-form textarea {
  min-height: 92px;
  padding: 12px;
}

.users-form {
  margin-bottom: 16px;
}

.users-table strong,
.users-table .user-note {
  display: block;
}

.user-note {
  margin-top: 3px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.role-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.status-badge[data-status="active"] {
  border-color: color-mix(in srgb, var(--success) 24%, var(--line));
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.status-badge[data-status="disabled"] {
  color: var(--muted);
}

.table-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.flag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.localized-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.localized-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
}

.localized-summary .missing {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
}

.table-actions a:hover,
.table-actions button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.main-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.main-footer strong {
  color: var(--accent-strong);
}

@media (max-width: 1240px) {
  .form-section-grid,
  .checkbox-grid,
  .integrations-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  }

  .nav-item {
    justify-content: center;
    text-align: center;
  }

  .theme-toggle {
    margin-top: 0;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .status-feed {
    justify-content: flex-start;
    border-radius: 8px;
  }

  .status-event {
    max-width: 100%;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .form-grid,
  .form-section-grid,
  .checkbox-grid,
  .integrations-list,
  .result-grid,
  .report-metrics,
  .viewer-grid,
  .filter-bar,
  .bulk-bar,
  .batch-controls {
    grid-template-columns: 1fr;
  }

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

  .check-item summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
