:root {
  color-scheme: light;
  --page: #f3f2ed;
  --ink: #1a221d;
  --ink-strong: #141a16;
  --ink-soft: #3d4a43;
  --muted: #7c877f;
  --muted-2: #9aa39c;
  --line: #e3e1d8;
  --line-strong: #d4dad2;
  --panel: #ffffff;
  --panel-soft: #fafaf7;
  --nav: #0c1310;
  --nav-2: #101814;
  --green: #15694c;
  --green-dark: color-mix(in srgb, var(--green) 70%, #050f0a);
  --green-soft: color-mix(in srgb, var(--green) 10%, #ffffff);
  --green-tint: color-mix(in srgb, var(--green) 16%, #ffffff);
  --amber: #d8852a;
  --amber-dark: #7a4806;
  --amber-bg: #fbf0dd;
  --red: #a4373a;
  --red-bg: #fbe5e4;
  --blue: #2d638f;
  --shadow-card: 0 1px 2px rgba(20, 30, 25, 0.04), 0 24px 48px -34px rgba(20, 30, 25, 0.26);
  --shadow-soft: 0 1px 2px rgba(20, 30, 25, 0.03), 0 18px 36px -28px rgba(20, 30, 25, 0.22);
  --pad: 24px;
  --gap: 22px;
  font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--green) 22%, #ffffff);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
.metric-tile strong,
.brand-preview strong {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
}

h1 {
  margin: 0;
  color: #f3f7f4;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-wrap: balance;
}

h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(34px, 3.2vw, 46px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.02;
  text-wrap: balance;
}

h3 {
  margin: 0;
  color: var(--ink-strong);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.12;
  text-wrap: balance;
}

p,
span,
td,
small,
label {
  text-wrap: pretty;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100vh;
  overflow: auto;
  padding: 22px 16px;
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 55%, #0d1511 100%);
  color: #cdd6d0;
}

.sidebar::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.sidebar::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 20px;
  background: #c9d1cb;
  background-clip: content-box;
}

.brand-block {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
}

.brand-block::after {
  content: "";
  grid-column: 1 / -1;
  height: 1px;
  margin-top: 12px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  color: #eafff5;
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 600;
  box-shadow:
    0 4px 14px -4px color-mix(in srgb, var(--green) 60%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-kicker,
.eyebrow,
.nav-label {
  margin: 0;
  color: color-mix(in srgb, var(--green) 58%, #728077);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-kicker {
  color: #5f7268;
  font-size: 9.5px;
  letter-spacing: 0.22em;
}

.nav-groups {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding: 4px;
}

.nav-groups section {
  display: grid;
  gap: 2px;
}

.nav-label {
  padding: 0 10px 7px;
  color: #566860;
  font-size: 9.5px;
  letter-spacing: 0.2em;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #aab6af;
  padding: 9px 11px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #e7eee9;
}

.nav-item.active {
  background: color-mix(in srgb, var(--green) 24%, #0d1612);
  color: #f1f6f3;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 40%, transparent);
  font-weight: 700;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--green);
}

.nav-icon {
  width: 14px;
  color: #5b6b62;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.nav-item.active .nav-icon {
  color: color-mix(in srgb, var(--green) 55%, #cfe9dd);
}

.muted-action {
  opacity: 1;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: auto;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 11px;
}

.user-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, #2a3a32, #1a251f);
  color: #dfe9e3;
  font-size: 13px;
  font-weight: 700;
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user strong {
  color: #eef3f0;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-user span {
  margin-top: 2px;
  color: #6c7c73;
  font-size: 11px;
}

.main-area {
  min-width: 0;
  padding: 0 38px 48px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 -38px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 242, 237, 0.84);
  padding: 28px 38px 18px;
  backdrop-filter: blur(12px);
}

.topbar-title {
  display: grid;
  gap: 10px;
}

.topbar-title .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green-dark);
}

.topbar-title .eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
}

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

.search-box {
  display: flex;
  align-items: center;
  width: min(42vw, 560px);
  min-width: 320px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(20, 30, 25, 0.03);
  padding: 0 14px;
}

.search-box span {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border: 2px solid var(--muted-2);
  border-radius: 999px;
}

.search-box input {
  width: 100%;
  min-height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-box kbd {
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted-2);
  padding: 2px 6px;
  font-family: inherit;
  font-size: 11px;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  padding: 0 14px;
  white-space: nowrap;
}

.connection-pill > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9e6c;
  box-shadow: 0 0 0 3px rgba(47, 158, 108, 0.16);
}

.connection-pill strong,
.connection-pill small {
  font-size: 13px;
}

.connection-pill strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.connection-pill small {
  color: var(--muted-2);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.command-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: var(--gap);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 18px 22px;
}

.command-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.ok-text {
  color: var(--green);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.metric-tile,
.panel {
  border: 1px solid #e7e5dd;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.metric-tile {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 132px;
  overflow: hidden;
  padding: var(--pad);
}

.metric-tile::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 12px;
  width: 42px;
  height: 2px;
  background: color-mix(in srgb, var(--green) 42%, #d2dbd5);
}

.metric-tile p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-tile strong {
  display: block;
  color: var(--ink-strong);
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1;
}

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

.dashboard-grid,
.module-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.panel {
  min-width: 0;
  padding: var(--pad);
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

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

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

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

th,
td {
  border-bottom: 1px solid #ededea;
  padding: 14px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

td {
  color: #56615a;
  font-size: 14px;
}

tbody tr:hover {
  background: var(--panel-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.ok {
  background: var(--green-soft);
  color: var(--green-dark);
}

.badge.warn {
  background: var(--amber-bg);
  color: #9a5a08;
}

.badge.neutral {
  background: #eef0ec;
  color: var(--ink-soft);
}

.table-link {
  color: var(--green-dark);
  font-weight: 800;
  text-decoration: none;
}

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

.step-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.step-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  color: #56615a;
  font-size: 14px;
  counter-increment: steps;
}

.step-list li::before {
  content: counter(steps);
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  color: #a3aca5;
  font-size: 11px;
  font-weight: 700;
}

.step-list .done {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: #cdd3cc;
}

.step-list .done::before {
  content: "✓";
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.step-list .current {
  margin: 2px 0;
  border: 1px solid #f1dfc0;
  border-radius: 11px;
  background: var(--amber-bg);
  color: var(--amber-dark);
  font-weight: 700;
  padding: 0 12px;
}

.step-list .current::before {
  content: "";
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(216, 133, 42, 0.16);
}

.risk-list,
.settings-list {
  display: grid;
  gap: 10px;
}

.risk-list div,
.settings-list div {
  display: grid;
  gap: 3px;
  border: 1px solid #ededea;
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 13px 14px;
}

.risk-list div {
  position: relative;
  padding-left: 28px;
}

.risk-list div::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 14px;
  width: 6px;
  border-radius: 6px;
  background: var(--red);
}

.risk-list div:nth-child(2)::before {
  background: var(--amber);
}

.risk-list div:nth-child(3)::before {
  background: #94a09a;
}

.risk-list span,
.settings-list span {
  color: var(--muted);
  font-size: 13px;
}

.timeline {
  display: grid;
}

.timeline div {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  border-bottom: 1px solid #ececea;
  color: var(--ink-soft);
  font-size: 14px;
  padding: 13px 0;
}

.timeline div:first-child {
  padding-top: 0;
}

.timeline span {
  color: var(--green-dark);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.module-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--gap);
  align-items: stretch;
  margin-bottom: var(--gap);
}

.module-hero > div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: var(--pad);
}

.module-hero p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.module-status {
  display: grid;
  align-content: center;
  gap: 6px;
}

.module-status span,
.module-status small {
  color: var(--muted);
  font-size: 13px;
}

.module-status strong {
  color: var(--ink);
  font-size: 16px;
}

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

.activity-section {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  border-top: 1px solid #ededea;
  padding-top: 22px;
}

.activity-toolbar,
.activity-summary,
.activity-row-header,
.activity-actions {
  display: flex;
  align-items: center;
}

.activity-toolbar {
  align-items: flex-start;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.activity-toolbar h4 {
  margin: 2px 0 0;
  color: var(--ink-strong);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.1;
}

.activity-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.activity-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-row {
  border: 1px solid #ededea;
  border-radius: 14px;
  background: var(--panel-soft);
  padding: 14px;
}

.activity-row-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.activity-row-header strong {
  color: var(--ink);
}

.remove-activity-button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
}

.activity-fields {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 12px;
}

.activity-summary {
  justify-content: space-between;
  gap: 14px;
  border: 1px dashed #cfd6cd;
  border-radius: 14px;
  background: #fff;
  padding: 14px 16px;
}

.activity-summary div {
  display: grid;
  gap: 2px;
}

.activity-summary span:not(.badge) {
  color: var(--muted);
  font-size: 12px;
}

.activity-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.source-card {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  padding: 14px;
}

.source-card > div:first-child {
  display: grid;
  gap: 4px;
}

.source-card strong {
  color: var(--ink-strong);
}

.source-card span,
.source-preview span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.source-preview {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.source-preview div {
  display: grid;
  gap: 2px;
}

.source-preview span {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-preview strong {
  font-size: 13.5px;
  line-height: 1.35;
}

.source-preview .warning-text {
  color: var(--amber-dark);
}

.serpro-summary {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.serpro-summary.active {
  display: grid;
}

.serpro-summary div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 12px 14px;
}

.serpro-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.serpro-summary strong {
  color: var(--ink-strong);
  font-size: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  border-radius: 4px;
  padding: 0;
  accent-color: var(--green);
}

input::placeholder {
  color: #a2aaa4;
}

input[type="color"] {
  padding: 7px;
}

.file-picker {
  position: relative;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-picker-button {
  display: inline-flex;
  align-items: center;
  height: 100%;
  border-right: 1px solid var(--line);
  background: #f1f4f0;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 700;
}

.file-picker-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  padding: 0 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.file-picker:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}

.check-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.policy-box {
  margin-top: 16px;
  border: 1px dashed #cfd6cd;
  border-radius: 12px;
  background: #fff;
  color: var(--ink-soft);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
}

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

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  padding: 0 16px;
  font-weight: 700;
}

button:hover {
  background: #faf9f5;
  border-color: #c2c8c1;
}

.primary-button {
  border-color: transparent;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  color: #f0fff8;
  box-shadow:
    0 8px 22px -10px color-mix(in srgb, var(--green) 75%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.primary-button:hover {
  border-color: transparent;
  background: linear-gradient(145deg, color-mix(in srgb, var(--green) 88%, white), var(--green-dark));
}

.danger-button {
  border-color: transparent;
  background: linear-gradient(145deg, #b84d50, var(--red));
  color: #ffffff;
}

.outline-button,
.ghost-button {
  background: var(--panel);
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

pre {
  overflow: auto;
  min-height: 300px;
  max-height: 560px;
  margin: 0;
  border: 1px solid #1d2b25;
  border-radius: 12px;
  background: #0d1511;
  color: #d8f3e9;
  padding: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.settings-output {
  min-height: 150px;
  max-height: 260px;
  margin-top: 16px;
}

.empty-state {
  display: grid;
  gap: 6px;
  min-height: 220px;
  align-content: center;
  justify-items: center;
  border: 1px dashed #cfd6cd;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.module-list,
.company-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.module-list button,
.company-grid article {
  display: grid;
  gap: 7px;
  min-height: 108px;
  align-content: start;
  border: 1px solid #ededea;
  border-radius: 14px;
  background: var(--panel-soft);
  padding: 16px;
  text-align: left;
}

.module-list button:hover,
.company-grid article:hover {
  background: #fff;
  border-color: var(--line-strong);
}

.brand-form {
  grid-template-columns: 1fr 140px 120px;
}

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

.span-2-fields {
  grid-column: span 2;
}

.settings-actions {
  margin-top: 16px;
}

.brand-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green-soft), transparent 42%), #fbfdfc;
  padding: 20px;
}

.brand-preview strong,
.brand-preview span {
  display: block;
}

.brand-preview strong {
  color: var(--ink-strong);
  font-size: 26px;
  font-weight: 500;
}

.brand-preview span {
  margin-top: 3px;
  color: var(--muted);
}

.preview-mark {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 11px;
}

.company-grid span,
.company-grid small {
  color: var(--muted);
}

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

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

.field-group {
  display: grid;
  gap: 8px;
}

.field-group > span {
  color: var(--ink-soft);
  font-weight: 700;
}

.event-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 12px;
}

.event-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.admin-list,
.event-routing-list {
  display: grid;
  gap: 10px;
}

.admin-card,
.routing-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 14px;
}

.admin-card {
  cursor: pointer;
}

.admin-card:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.admin-card header,
.routing-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.card-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.card-actions .ghost-button {
  min-height: 27px;
  padding: 5px 10px;
  font-size: 12px;
}

.admin-card header div {
  display: grid;
  gap: 3px;
}

.admin-card strong,
.routing-row strong {
  color: var(--ink-strong);
}

.admin-card span,
.routing-row span {
  color: var(--muted);
}

.admin-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.admin-card dl div {
  display: grid;
  gap: 2px;
}

.admin-card dt {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-card dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.event-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.automation-preview {
  display: grid;
  gap: 12px;
}

.automation-preview div {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.automation-preview div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.automation-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.automation-preview strong {
  color: var(--ink-strong);
  font-size: 16px;
}

.full-width-button {
  width: 100%;
  margin-top: 16px;
}

.automation-run-output {
  max-height: 260px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid #dfe5dc;
  border-radius: 12px;
  background: #0d1712;
  color: #dbe7df;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.compact-empty {
  min-height: 120px;
}

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

  .metric-tile:last-child {
    grid-column: span 2;
  }
}

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

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

  .brand-block {
    border-bottom: 0;
  }

  .brand-block::after {
    display: none;
  }

  .nav-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .sidebar-user {
    display: none;
  }

  .main-area {
    padding-inline: 22px;
  }

  .topbar {
    margin-inline: -22px;
    padding-inline: 22px;
  }

  .command-strip,
  .module-hero {
    grid-template-columns: 1fr 1fr;
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }

  .module-list,
  .company-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar-actions,
  .search-box {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --pad: 18px;
    --gap: 14px;
  }

  .main-area {
    padding: 0 14px 34px;
  }

  .topbar {
    margin-inline: -14px;
    padding: 20px 14px 14px;
  }

  .nav-groups {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .nav-groups section {
    flex: 0 0 220px;
  }

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

  .connection-pill,
  .outline-button {
    flex: 1;
    justify-content: center;
  }

  .command-strip,
  .metric-grid,
  .module-hero,
  .form-grid,
  .brand-form,
  .serpro-form,
  .activity-fields,
  .serpro-summary,
  .automation-grid,
  .event-options {
    grid-template-columns: 1fr;
  }

  .activity-toolbar,
  .activity-summary {
    align-items: stretch;
    flex-direction: column;
  }

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

  .metric-tile:last-child,
  .span-2-fields {
    grid-column: auto;
  }

  h2 {
    font-size: 34px;
  }
}
