@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700;800&display=swap');

:root {
  --bg: #f4efe6;
  --bg-soft: #ede5d8;
  --paper: rgba(255, 252, 247, 0.92);
  --paper-strong: #fffdf9;
  --ink: #18212f;
  --ink-soft: #556072;
  --line: rgba(24, 33, 47, 0.12);
  --line-strong: rgba(24, 33, 47, 0.2);
  --navy: #152033;
  --navy-soft: #1d2a41;
  --gold: #b88a43;
  --gold-soft: rgba(184, 138, 67, 0.14);
  --green: #3c7a5f;
  --green-soft: rgba(60, 122, 95, 0.14);
  --red: #a85145;
  --red-soft: rgba(168, 81, 69, 0.12);
  --shadow: 0 18px 50px rgba(21, 32, 51, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(184, 138, 67, 0.12), transparent 26%),
    radial-gradient(circle at top right, rgba(21, 32, 51, 0.06), transparent 22%),
    linear-gradient(180deg, #f7f2e9 0%, #f1eadf 48%, #ece2d3 100%);
}

a { color: inherit; text-decoration: none; }
p { margin: 0; }
strong { font-weight: 600; }
small { color: var(--ink-soft); }
button, input, select, textarea { font: inherit; }
button, .button-secondary, .button-primary { appearance: none; text-decoration: none; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}
.hero-panel p,
.panel p,
.auth-card p,
.focus-list span,
.timeline span,
.details dd,
td,
label,
input,
select,
textarea { font-family: Inter, Arial, sans-serif; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 288px;
  padding: clamp(12px, 1.6vh, 24px) 16px;
  background: #152033;
  color: #f6f1e8;
  border-right: 1px solid rgba(255,255,255,.08);
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vh, 16px);
  overflow-y: auto;
}
.sidebar::before { display: none; }
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 6px clamp(10px, 1.4vh, 16px) 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-badge {
  width: clamp(34px, 4.2vh, 44px);
  height: clamp(34px, 4.2vh, 44px);
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 auto;
  background: transparent;
  display: block;
}
.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand strong,
.user-chip strong,
.nav-section,
.panel h2,
.card-link h2,
.auth-card h1,
h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: -.02em;
}
.metric-tile strong,
.stat-card strong,
.editorial-cell strong,
.summary-row strong {
  font-family: Inter, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}
.brand span,
.sidebar-note,
.user-chip span {
  color: rgba(246, 241, 232, 0.68);
}
.table-sub,
.page-head p,
.timeline span,
.timeline time,
.details dt,
.card-link small,
.card-link p,
.stat-card span,
.stat-card small {
  color: var(--ink-soft);
}
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-copy strong { font-size: clamp(15px, 1.9vh, 18px); }
.brand-copy span { font-size: 12px; }
.sidebar-note {
  margin-left: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.04);
  line-height: 1.45;
  font-size: 13px;
}
.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(244, 231, 208, 0.62);
  margin: 2px 8px 4px 12px;
}
.sidebar nav { display: flex; flex-direction: column; gap: clamp(1px, 0.4vh, 6px); flex: 0 0 auto; }
.nav-group {
  margin: clamp(3px, 0.9vh, 12px) 8px clamp(1px, 0.3vh, 4px) 12px;
  padding-top: clamp(2px, 0.6vh, 8px);
  border-top: 1px solid rgba(244, 231, 208, 0.12);
  color: rgba(244, 231, 208, 0.5);
}
.card-link.has-alert {
  border-color: var(--gold, #c8a24a);
  box-shadow: 0 0 0 1px var(--gold, #c8a24a), 0 6px 18px rgba(200, 162, 74, 0.15);
}
.badge.alert-badge {
  background: rgba(200, 162, 74, 0.16);
  color: #8a6a1a;
  font-weight: 600;
}
.leados-toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 36px));
}
.leados-toast {
  background: #fffaf0;
  border: 1px solid var(--gold, #c8a24a);
  border-left: 4px solid var(--gold, #c8a24a);
  border-radius: 12px;
  padding: 12px 34px 12px 14px;
  box-shadow: 0 8px 28px rgba(24, 33, 47, 0.18);
  color: var(--ink, #1a2230);
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.leados-toast.is-in { opacity: 1; transform: translateY(0); }
.leados-toast.is-leaving { opacity: 0; transform: translateY(10px); }
.leados-toast-title { font-weight: 700; font-size: .9rem; margin-bottom: 3px; }
.leados-toast-msg { font-size: .82rem; line-height: 1.4; color: var(--ink-soft, #5a6573); }
.leados-toast-link { display: inline-block; margin-top: 7px; font-size: .82rem; font-weight: 600; color: var(--ink, #1a2230); text-decoration: underline; }
.leados-toast-x {
  position: absolute; top: 6px; right: 8px;
  background: none; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--ink-soft, #5a6573);
}
.leados-toast-x:hover { color: var(--ink, #1a2230); }
.pager-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
}
.pager-more { font-size: .85rem; }
.pager-more-meta { opacity: .6; font-weight: 400; }
.pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-btn,
.pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: .85rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border, rgba(0,0,0,.12));
  background: transparent;
}
.pager-num.is-current {
  background: var(--accent, #8a6d3b);
  border-color: var(--accent, #8a6d3b);
  color: #fff;
  font-weight: 600;
}
.pager-btn:hover:not(.is-disabled),
.pager-num:hover:not(.is-current) { background: rgba(0,0,0,.05); }
.pager-btn.is-disabled { opacity: .4; pointer-events: none; }
.pager-gap { padding: 0 4px; opacity: .5; }
.pager-total { margin-left: 8px; font-size: .8rem; opacity: .6; }
.ghost,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 14px;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .18s ease;
}
.sidebar nav a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .18s ease;
  justify-content: flex-start;
  color: rgba(246, 241, 232, 0.76);
  margin-left: 10px;
  padding: clamp(4px, 0.85vh, 11px) 12px;
  font-size: clamp(13px, 1.6vh, 15px);
}
.sidebar nav a .nav-icon {
  width: clamp(16px, 2vh, 19px);
  height: clamp(16px, 2vh, 19px);
  flex: 0 0 auto;
  color: rgba(244, 231, 208, 0.55);
  transition: .18s ease;
}
.sidebar nav a.active,
.sidebar nav a:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.08);
  color: #fffdf8;
  transform: translateX(2px);
}
.sidebar nav a.active .nav-icon,
.sidebar nav a:hover .nav-icon { color: #e4b668; }
.sidebar-foot { flex: 0 0 auto; display: flex; flex-direction: column; gap: clamp(4px, 0.7vh, 8px); padding-left: 10px; padding-top: clamp(4px, 0.8vh, 10px); border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot .ghost { padding: clamp(7px, 1vh, 13px) 15px; }
.user-chip {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  padding: clamp(6px, 1vh, 11px) 14px;
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.user-chip-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(244, 231, 208, 0.56);
}
.user-chip strong {
  display: block;
  font-size: clamp(15px, 1.9vh, 18px);
  margin-bottom: 2px;
  color: #fffaf1;
}
.user-chip-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(246, 241, 232, 0.74);
}
.user-chip-meta::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #6fd3a5;
  box-shadow: 0 0 0 4px rgba(111, 211, 165, 0.14);
}
.ghost {
  width: 100%;
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.08);
  color: #f6f1e8;
}
.ghost:hover { background: rgba(255,255,255,.09); }
.ghost.danger { color: #ffd3cb; }

.content { flex: 1; padding: 30px; }
.content-auth { display: grid; place-items: center; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head h1,
.auth-card h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: .96;
}
.page-head p { color: var(--ink-soft); max-width: 680px; line-height: 1.55; }
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 14px;
}
.page-meta strong { color: var(--ink); }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}
.page-header h1,
.page-header h2 {
  margin: 0 0 10px;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 0.98;
}
.page-header p {
  color: var(--ink-soft);
  max-width: 760px;
  line-height: 1.55;
}
.eyebrow {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(21, 32, 51, 0.05);
  color: var(--ink-soft);
  border: 1px solid rgba(21, 32, 51, 0.08);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 12px;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--gold);
}

.hero-grid,
.stats-grid,
.cards-grid,
.grid.two,
.form-grid,
.check-grid { display: grid; gap: 18px; }
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.quick-action-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(24, 33, 47, 0.08);
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.quick-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 138, 67, 0.3);
}
.quick-action-card strong {
  font-size: 20px;
  line-height: 1.1;
}
.quick-action-card small {
  color: var(--ink-soft);
  line-height: 1.5;
}
.hero-grid { grid-template-columns: 1.28fr .72fr; margin-bottom: 24px; }
.hero-panel,
.panel,
.subpanel,
.auth-card,
.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero-panel,
.panel,
.subpanel,
.auth-card { border-radius: var(--radius-xl); }
.hero-panel {
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.hero-panel.hero-panel-contrast {
  background: linear-gradient(180deg, #182233, #22314a);
  color: #f7f2e8;
}
.hero-panel.hero-panel-contrast p,
.hero-panel.hero-panel-contrast .eyebrow,
.hero-panel.hero-panel-contrast .metric-tile span,
.hero-panel.hero-panel-contrast .focus-list span {
  color: rgba(247, 242, 232, 0.78);
}
.hero-panel.hero-panel-contrast .eyebrow {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.08);
}
.hero-panel.hero-panel-contrast .eyebrow::before { background: #e4b668; }
.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -80px -90px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(184,138,67,.16), transparent 66%);
  pointer-events: none;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.hero-inline-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(247, 242, 232, 0.82);
  font-size: 13px;
}
.hero-inline-meta strong {
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
}
.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-top: 24px;
}
.metric-tile {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(24, 33, 47, 0.08);
}
.hero-panel-contrast .metric-tile {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.09);
}
.metric-tile strong { display: block; font-size: 28px; margin-bottom: 4px; }
.metric-tile span { color: var(--ink-soft); font-size: 13px; }
.focus-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.focus-list li {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.64);
  border: 1px solid rgba(24, 33, 47, 0.08);
}
.hero-panel-contrast .focus-list li {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
}
.focus-list strong { display: block; margin-bottom: 5px; }
.focus-list span { color: var(--ink-soft); font-size: 14px; }

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 24px;
}
.stat-card {
  border-radius: 22px;
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--gold), rgba(184, 138, 67, 0));
}
.stat-card span { display: block; color: var(--ink-soft); margin-bottom: 12px; }
.stat-card strong { display: block; font-size: 38px; margin-bottom: 8px; }
.stat-card small { color: var(--ink-soft); font-size: 13px; }

.grid.two { grid-template-columns: 1.08fr .92fr; margin-bottom: 24px; }
.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px,1fr));
  margin-bottom: 24px;
}
.panel,
.subpanel,
.auth-card { padding: 24px; }
.filter-panel { margin-bottom: 18px; }
.subpanel { background: rgba(255,255,255,.72); }
.panel-head,
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.panel h2,
.card-link h2 { margin: 0 0 10px; font-size: 28px; line-height: 1.05; }
.card-link h2 { font-size: 24px; }
.hero-panel h2,
.editorial-kicker strong,
.editorial-cell strong {
  font-family: Inter, Arial, sans-serif;
  letter-spacing: -.03em;
}
.hero-panel h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.05;
}
.panel-head a {
  color: #74501f;
  font-weight: 600;
}
.panel-head a::after {
  content: "→";
  margin-left: 6px;
}
.card-link {
  display: block;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 54px rgba(21, 32, 51, 0.11);
  border-color: var(--line-strong);
}
.card-link h2 a:hover,
.panel a:hover { color: #74501f; }
.card-link p,
.panel p,
.timeline span,
.timeline time,
.table-sub,
.details dd,
label,
.auth-card p { color: var(--ink-soft); }
.card-link p,
.card-link small,
.timeline span,
.timeline time,
.helper-copy,
.empty-state span {
  line-height: 1.5;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
  background: var(--green-soft);
  color: var(--green);
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: .7;
}
.badge.soft {
  background: rgba(21, 32, 51, 0.06);
  color: var(--ink-soft);
}
.badge.success {
  background: var(--green-soft);
  color: var(--green);
}
.badge.warning {
  background: rgba(184, 138, 67, 0.15);
  color: #8b662a;
}
.badge.danger,
.badge.muted {
  background: var(--red-soft);
  color: var(--red);
}
.badge.neutral {
  background: rgba(21, 32, 51, 0.08);
  color: var(--navy-soft);
}
.button-primary,
.button-secondary,
button {
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s ease;
}
.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #162133, #31405e);
  color: #fffdf8;
  border: 1px solid rgba(21, 32, 51, 0.08);
  box-shadow: 0 14px 30px rgba(21, 32, 51, 0.12);
  white-space: nowrap;
}
.button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(21, 32, 51, 0.16);
}
.button-secondary {
  background: rgba(21, 32, 51, 0.04);
  border: 1px solid rgba(21, 32, 51, 0.08);
  color: var(--ink);
}
.button-secondary:hover {
  background: rgba(21, 32, 51, 0.08);
  border-color: rgba(21, 32, 51, 0.12);
}
button {
  border: 1px solid rgba(21, 32, 51, 0.08);
  background: linear-gradient(135deg, #162133, #31405e);
  color: #fffdf8;
  box-shadow: 0 10px 24px rgba(21, 32, 51, 0.12);
}
button:hover { transform: translateY(-1px); }
button.danger { background: transparent; color: var(--red); border-color: rgba(168,81,69,.2); box-shadow: none; }
.table-wrap { overflow: auto; border-radius: 18px; border: 1px solid rgba(24, 33, 47, 0.08); background: rgba(255,255,255,.28); }
.mono-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #31405e;
}
.mono-link:hover { color: #74501f; }

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,.32);
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(24, 33, 47, 0.08);
  vertical-align: top;
}
th {
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  background: rgba(21, 32, 51, 0.03);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.58); }
td .badge { margin-top: 2px; }
td strong { font-size: 14px; }
.dense-table th,
.dense-table td { padding: 11px 12px; }
.dense-table-wrap { background: rgba(255,255,255,.4); }

.stack, .stack-sm, .stack-lg, .details { display: flex; flex-direction: column; }
.stack { gap: 16px; }
.stack-sm { gap: 14px; }
.stack-lg { gap: 24px; }
.stack-xs { display: flex; flex-direction: column; gap: 10px; }

.workflow-builder-grid { align-items: start; }
.route-builder-card,
.route-inspector-card { overflow: hidden; }
.route-meta-bar {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items: start;
}
.route-meta-controls {
  display: grid;
  gap: 14px;
}
.route-active-toggle {
  padding: 14px 16px;
  border: 1px solid rgba(24, 33, 47, 0.08);
  border-radius: 16px;
  background: rgba(255,255,255,.54);
}
.route-canvas {
  border: 1px solid rgba(24, 33, 47, 0.08);
  border-radius: 24px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,248,240,.72)),
    radial-gradient(circle at top, rgba(184, 138, 67, 0.08), transparent 46%);
}
.route-canvas-head h2 {
  margin: 0 0 6px;
  font-size: 30px;
}
.route-canvas-head p {
  color: var(--ink-soft);
  line-height: 1.5;
}
.route-builder-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 20px;
}
.button-compact {
  min-height: 40px;
  padding: 9px 12px;
}
.route-trigger-card {
  width: 100%;
  margin-bottom: 18px;
}
.route-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.route-selector-card-wide {
  grid-column: 1 / -1;
}
.route-selector-card {
  border: 1px solid rgba(21, 32, 51, 0.08);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,.58);
}
.route-selector-card-inline {
  grid-column: 1 / -1;
}
.route-selector-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.route-selector-head strong {
  font-size: 15px;
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(21, 32, 51, 0.06);
  border: 1px solid rgba(21, 32, 51, 0.08);
  color: var(--ink);
  font-size: 13px;
}
.chip-empty {
  color: var(--ink-soft);
}
.route-node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.route-editor-node {
  width: 100%;
  padding: 18px;
}
.route-editor-node-head {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
}
.route-icon-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(21, 32, 51, 0.08);
  background: rgba(255,255,255,.74);
  color: var(--ink-soft);
  cursor: pointer;
  transition: .18s ease;
}
.route-icon-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.route-icon-button:hover {
  background: rgba(21, 32, 51, 0.08);
  color: var(--ink);
}
.route-editor-node-head strong {
  font-size: 24px;
}
.route-editor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.route-editor-field-wide {
  grid-column: 1 / -1;
}
.route-editor-hint {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(21, 32, 51, 0.04);
  border: 1px solid rgba(21, 32, 51, 0.06);
  color: var(--ink-soft);
  line-height: 1.5;
}
.route-node-delete {
  flex: 0 0 auto;
}
.route-picker-modal[hidden] { display: none; }
.route-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.route-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 32, 51, 0.42);
}
.route-picker-dialog {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  margin: 24px auto;
  padding: 22px;
  border-radius: 24px;
  background: #fffdf9;
  border: 1px solid rgba(21, 32, 51, 0.08);
  box-shadow: 0 24px 72px rgba(21, 32, 51, 0.24);
}
.route-picker-header,
.route-picker-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.route-picker-header {
  margin-bottom: 18px;
}
.route-picker-header h3 {
  margin: 0;
  font-size: 28px;
}
.route-picker-actions {
  margin-top: 18px;
  justify-content: flex-end;
}
.route-picker-options {
  display: grid;
  gap: 10px;
}
.route-picker-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(21, 32, 51, 0.08);
  background: rgba(255,255,255,.76);
}
.route-picker-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}
.route-picker-option span {
  color: var(--ink);
}
.route-tree {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.route-node {
  width: min(100%, 620px);
  border-radius: 22px;
  border: 1px solid rgba(24, 33, 47, 0.1);
  background: rgba(255,255,255,.9);
  box-shadow: 0 14px 34px rgba(21, 32, 51, 0.06);
  padding: 18px 20px;
}
.route-node-trigger {
  background: linear-gradient(180deg, rgba(21,32,51,.04), rgba(255,255,255,.96));
}
.route-node-primary {
  background: linear-gradient(180deg, rgba(60,122,95,.06), rgba(255,255,255,.96));
}
.route-node-delay {
  background: linear-gradient(180deg, rgba(21,32,51,.03), rgba(255,255,255,.96));
}
.route-node-fallback {
  background: linear-gradient(180deg, rgba(184,138,67,.08), rgba(255,255,255,.96));
}
.route-node-outcome {
  background: linear-gradient(180deg, rgba(60,122,95,.08), rgba(255,255,255,.96));
}
.route-node-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.route-node-kicker {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(21, 32, 51, 0.06);
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.route-node-head strong {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  line-height: 1;
}
.route-node-text {
  margin-bottom: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.route-node-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(21, 32, 51, 0.04);
  border: 1px solid rgba(21, 32, 51, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.route-connector-vertical {
  width: 2px;
  height: 34px;
  background: linear-gradient(180deg, rgba(184,138,67,.24), rgba(21,32,51,.22));
}
.route-branch-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 620px) 220px;
  justify-content: center;
  gap: 30px;
  align-items: start;
}
.route-branch-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.route-branch-side {
  position: relative;
  padding-top: 44px;
}
.route-side-connector {
  position: absolute;
  top: 78px;
  left: -30px;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, rgba(60,122,95,.2), rgba(60,122,95,.5));
}
.workflow-card,
.advanced-box {
  border: 1px solid rgba(24, 33, 47, 0.08);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,.48);
}
.workflow-card-fallback { background: rgba(184, 138, 67, 0.08); }
.workflow-card-conditions { background: rgba(21, 32, 51, 0.04); }
.workflow-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.workflow-card-head strong { display: block; margin-bottom: 4px; }
.workflow-card-head p { color: var(--ink-soft); line-height: 1.45; }
.workflow-arrow {
  text-align: center;
  font-size: 26px;
  color: var(--gold);
  line-height: 1;
}
.badge-warning {
  background: rgba(184, 138, 67, 0.12);
  color: #7a5922;
  border-color: rgba(184, 138, 67, 0.2);
}
.badge-muted {
  background: rgba(21, 32, 51, 0.06);
  color: var(--ink-soft);
  border-color: rgba(21, 32, 51, 0.12);
}
.advanced-box summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 12px;
}
.advanced-box[open] summary { margin-bottom: 14px; }
.workflow-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.workflow-preview-block {
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(60, 122, 95, 0.1);
  border: 1px solid rgba(60, 122, 95, 0.14);
}
.workflow-preview-block-soft {
  background: rgba(184, 138, 67, 0.08);
  border-color: rgba(184, 138, 67, 0.14);
}
.workflow-preview-block-neutral {
  background: rgba(21, 32, 51, 0.04);
  border-color: rgba(21, 32, 51, 0.08);
}
.workflow-preview-block strong {
  display: block;
  margin-bottom: 6px;
}
.workflow-preview-block p,
.workflow-preview-connector {
  color: var(--ink-soft);
  line-height: 1.45;
}

label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
input, select, textarea {
  width: 100%;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  border: 1px solid rgba(24, 33, 47, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(184, 138, 67, 0.7);
  box-shadow: 0 0 0 4px rgba(184, 138, 67, 0.12);
}
textarea { resize: vertical; min-height: 96px; }
.form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.policy-grid { align-items: start; }
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.alert,
.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(184, 138, 67, 0.18);
}
.flash {
  background: rgba(60, 122, 95, 0.11);
  border-color: rgba(60, 122, 95, 0.18);
  color: #2f5d49;
}
.attention-banner {
  margin-top: -4px;
  margin-bottom: 20px;
}
.alert {
  background: rgba(168,81,69,.1);
  border-color: rgba(168,81,69,.18);
  color: #87453b;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline li,
.list-row,
.check {
  border: 1px solid rgba(24, 33, 47, 0.08);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,.56);
}
.timeline li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.timeline strong { display: block; margin-bottom: 6px; }
.timeline time,
td,
th,
.summary-row strong,
.metric-tile strong,
.stat-card strong,
.editorial-cell strong { font-variant-numeric: tabular-nums; }
.compact li { padding: 12px 14px; }
.details { gap: 12px; }
.details div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  border-bottom: 1px solid rgba(24, 33, 47, 0.08);
  padding-bottom: 12px;
}
.details dd { margin: 0; }
.check-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}
.compact-check {
  padding: 12px 14px;
  min-height: 72px;
}
.compact-check.is-selected {
  border-color: rgba(184, 138, 67, 0.28);
  background: rgba(255,249,239,.85);
}
.inline-check { padding: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; }
.check span { display: flex; flex-direction: column; gap: 4px; }
.helper-copy {
  margin-top: -4px;
  font-size: 14px;
  color: var(--ink-soft);
}
.check small,
.card-link small {
  display: block;
}
.summary-card {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(24, 33, 47, 0.08);
  border-radius: 18px;
  background: rgba(255,255,255,.54);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(24, 33, 47, 0.08);
}
.summary-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.summary-row span {
  color: var(--ink-soft);
}
.empty-state {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(21, 32, 51, 0.03);
  color: var(--ink-soft);
}
.empty-state strong {
  color: var(--ink);
}
.empty-state-inline {
  margin: 4px 0;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
.filter-bar > label {
  flex: 1 1 160px;
  min-width: 140px;
  margin: 0;
}
.filter-bar > label:first-of-type {
  flex: 2 1 240px;
}
.filter-bar > label.filter-date,
.filter-bar > label[data-field="date"] {
  flex: 0 0 160px;
}
.filter-bar input,
.filter-bar select {
  height: 44px;
  padding: 0 14px;
  line-height: 1.2;
  box-sizing: border-box;
}
.filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  height: 44px;
  flex-wrap: wrap;
}
.table-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #74501f;
  font-weight: 600;
  white-space: nowrap;
}
.table-action::after { content: "→"; }
.card-link.is-attention,
.panel.is-attention {
  border-color: rgba(184, 138, 67, 0.28);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,247,232,.9));
}
pre {
  overflow: auto;
  background: #f9f4eb;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(24, 33, 47, 0.08);
  color: #374255;
}
.auth-card {
  width: min(560px, 92vw);
  padding: 34px;
  position: relative;
  overflow: hidden;
}
.auth-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -30px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(184, 138, 67, 0.17), transparent 68%);
}
.auth-card > * { position: relative; z-index: 1; }
.login-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(21, 32, 51, 0.05);
  border: 1px solid rgba(21, 32, 51, 0.08);
  margin-bottom: 18px;
}
.login-mark strong { font-family: Fraunces, Georgia, serif; }
.login-mark span { color: var(--ink-soft); font-size: 13px; }

.editorial-band {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
.editorial-kicker,
.editorial-summary {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.64);
  box-shadow: var(--shadow);
}
.editorial-kicker {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: flex-start;
}
.editorial-kicker strong {
  font-size: 24px;
  line-height: 1.08;
}
.editorial-kicker span,
.editorial-summary p { color: var(--ink-soft); }
.editorial-summary {
  padding: 22px 24px;
}
.editorial-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
  margin-top: 16px;
}
.compact-summary-grid {
  margin-top: 18px;
}
.compact-summary-layout {
  grid-template-columns: repeat(3, minmax(0,1fr));
}
.editorial-cell {
  padding-top: 14px;
  border-top: 1px solid rgba(24,33,47,.08);
}
.editorial-cell strong {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 26px;
  margin-bottom: 4px;
}
.lead-grid {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 18px;
  margin-bottom: 24px;
}
.lead-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 1180px) {
  .quick-actions-grid,
  .hero-grid,
  .grid.two,
  .lead-grid,
  .editorial-band { grid-template-columns: 1fr; }
  .filter-bar > label,
  .filter-bar > label:first-of-type,
  .filter-bar > label.filter-date,
  .filter-bar > label[data-field="date"] { flex: 1 1 calc(50% - 14px); }
  .route-meta-bar,
  .route-branch-layout { grid-template-columns: 1fr; }
  .route-branch-side {
    padding-top: 0;
  }
  .route-side-connector {
    display: none;
  }
  .route-selector-grid,
  .route-editor-fields {
    grid-template-columns: 1fr;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 980px) {
  .shell { display: block; }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
    overflow: visible;
  }
  .content { padding: 22px; }
  .form-grid,
  .compact-summary-layout,
  .metric-strip,
  .details div,
  .editorial-summary-grid { grid-template-columns: 1fr; }
  .filter-bar > label,
  .filter-bar > label:first-of-type,
  .filter-bar > label.filter-date,
  .filter-bar > label[data-field="date"] { flex: 1 1 100%; }
  .page-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .sidebar { padding: 20px 16px; }
  .hero-panel,
  .panel,
  .subpanel,
  .auth-card { padding: 20px; border-radius: 22px; }
  .stat-card strong,
  .metric-tile strong { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* === Route flow editor (Drawflow) === */
.product-fields-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.product-field-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(24,33,47,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.55);
}
.product-field-row > label { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.product-field-row input,
.product-field-row select {
  height: 44px;
  padding: 0 14px;
  line-height: 1.2;
  box-sizing: border-box;
}
.product-field-remove { align-self: end; height: 44px; padding: 0 16px; }
@media (max-width: 760px) {
  .product-field-row { grid-template-columns: 1fr; }
}
.editable-title-row { display: flex; align-items: center; gap: 10px; }
.editable-title-row h1[data-editable-title] {
  margin: 0;
  outline: none;
}
.editable-title-row h1[data-editable-title].is-editing {
  background: rgba(184,138,67,.08);
  box-shadow: 0 0 0 2px rgba(184,138,67,.35);
  border-radius: 8px;
  padding: 2px 8px;
}
.editable-title-trigger {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(24,33,47,.12);
  background: rgba(255,255,255,.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 0;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.editable-title-trigger:hover {
  background: rgba(184,138,67,.14);
  color: var(--ink);
  border-color: rgba(184,138,67,.32);
}
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.dashboard-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 18px 18px 18px 14px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(24,33,47,.08);
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease;
  cursor: grab;
}
.dashboard-card:hover {
  border-color: rgba(184,138,67,.4);
  box-shadow: 0 10px 24px rgba(15,22,33,.08);
  transform: translateY(-1px);
}
.dashboard-card.is-empty { background: rgba(255,255,255,.45); }
.dashboard-card.is-empty .dashboard-card-value { color: var(--ink-soft); }
.dashboard-card.is-dragging { opacity: .55; cursor: grabbing; }
.cards-grid > .panel.card-link[draggable="true"] { cursor: grab; }
.cards-grid > .panel.card-link[draggable="true"]:active { cursor: grabbing; }
.cards-grid > .panel.card-link.is-dragging { opacity: .55; }
.cards-grid > .panel.card-link { overflow: hidden; }
.cards-grid > .panel.card-link h2,
.cards-grid > .panel.card-link p,
.cards-grid > .panel.card-link small { overflow-wrap: anywhere; word-break: break-word; }
.dashboard-card-handle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1;
  letter-spacing: -.05em;
  padding-top: 4px;
}
.dashboard-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dashboard-card-value {
  font-family: Inter, Arial, sans-serif;
  font-size: 30px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.dashboard-card-label {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 16px;
  letter-spacing: -.01em;
  line-height: 1.25;
}
.dashboard-card-meta { font-size: 12px; color: var(--ink-soft); }
.route-flow-form { display: flex; flex-direction: column; gap: 18px; }
.route-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.route-delete-icon-form { flex: 0 0 auto; }
.route-delete-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(168,81,69,.18);
  background: rgba(168,81,69,.08);
  color: #87453b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .18s ease, color .18s ease;
}
.route-delete-icon:hover { background: #87453b; color: #fff; }
.route-delete-icon svg { width: 20px; height: 20px; }
.route-meta-bar {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  padding: 18px 20px;
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(24,33,47,.08);
  border-radius: 18px;
}
.route-meta-copy { display: flex; flex-direction: column; gap: 10px; }
.route-meta-controls { display: flex; flex-direction: column; gap: 10px; }
/* Шапка маршрута v2: название на всю ширину, ниже 1/4 описание + 3/4 настройки */
.route-meta-bar-v2 { display: flex; flex-direction: column; gap: 16px; padding: 18px 20px; background: rgba(255,255,255,.5); border: 1px solid rgba(24,33,47,.08); border-radius: 18px; }
.route-meta-name { display: flex; flex-direction: column; gap: 8px; }
.route-meta-row { display: grid; grid-template-columns: 1fr 3fr; gap: 20px; align-items: start; }
.route-meta-desc { display: flex; flex-direction: column; gap: 8px; }
.route-meta-desc textarea { min-height: 120px; }
.route-meta-settings { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 18px; }
.route-meta-settings > label { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 860px) { .route-meta-row { grid-template-columns: 1fr; } .route-meta-settings { grid-template-columns: 1fr; } }
.checkbox-row.is-used { opacity: .6; }
.route-trigger-panel { padding: 18px 20px; background: rgba(255,255,255,.5); border: 1px solid rgba(24,33,47,.08); border-radius: 18px; min-height: 180px; }
.route-trigger-panel:empty { display: none; }
.route-rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.route-rule-grid > label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.route-trigger-window { display: flex; gap: 12px; }
.route-trigger-window > label { flex: 1 1 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.src-status { font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.src-status-on { background: rgba(38,128,74,.14); color: #2c7a4b; }
.src-status-off { background: rgba(176,58,46,.12); color: #b03a2e; font-weight: 500; }
.src-status-off a { color: inherit; font-weight: 600; text-decoration: underline; }
.checkbox-row.is-inactive .src-name { opacity: .7; }
.checkbox-row .src-name { font-weight: 500; }
label.checkbox-row,
.checkbox-row {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px;
  font-size: 14px;
  text-align: left;
}
label.checkbox-row input[type="checkbox"],
.checkbox-row input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
  padding: 0;
  margin: 0;
}
.route-palette-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(24,33,47,.08);
  border-radius: 18px;
  flex-wrap: wrap;
}
/* «Мост» маршрута: Источники → Получатели */
.route-bridge-bar { margin-bottom: 12px; }
.route-bridge { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; background: var(--gold-soft, #f3ead7); border: 1px solid rgba(24,33,47,.08); border-radius: 18px; }
.route-bridge-col { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.route-bridge-label { font-weight: 600; font-size: .82rem; color: var(--ink-soft); margin-right: 4px; }
.route-bridge-arrow { font-size: 1.3rem; color: var(--gold, #caa14a); }
.route-bridge-chip { display: inline-flex; align-items: center; padding: .15rem .55rem; border: 1px solid rgba(24,33,47,.14); border-radius: 999px; background: #fff; font-size: .8rem; }
.route-palette-bar-label {
  align-self: center;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 16px;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-right: 4px;
}
.route-palette-bar-hint {
  align-self: center;
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
  max-width: 320px;
}
.route-palette-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(24,33,47,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  cursor: grab;
  font: inherit;
  color: var(--ink);
  text-align: left;
}
.route-palette-chip:hover { background: #fff; }
.route-palette-chip:active { cursor: grabbing; }
.route-palette-text { display: flex; flex-direction: column; gap: 1px; }
.route-palette-text strong { font-size: 14px; }
.route-palette-text small { color: var(--ink-soft); font-size: 12px; }
.route-palette-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(184,138,67,.18);
  color: #8a5d20;
  font-weight: 700;
}
.route-inspector-bottom {
  margin-top: 18px;
  padding: 24px 26px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(24,33,47,.08);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.route-inspector-trigger { gap: 22px; }
.route-inspector-trigger > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.route-inspector-trigger > div:first-child strong { font-family: "Playfair Display", Georgia, serif; font-size: 20px; letter-spacing: -.01em; }
.route-inspector-trigger > div:first-child p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.route-inspector-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 22px;
  align-items: start;
}
.route-inspector-columns > div { display: flex; flex-direction: column; gap: 8px; }
.route-inspector-columns > div p.muted { margin: 0 0 4px; font-size: 13px; line-height: 1.45; }
.route-inspector-sublabel {
  display: block;
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  margin: 0 0 2px;
}
.route-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(24,33,47,.08);
  border-radius: 14px;
}
.route-required-fields { display: flex; flex-direction: column; gap: 10px; }
.route-palette-legend {
  margin-top: 4px;
  padding: 12px;
  background: rgba(184,138,67,.08);
  border-radius: 14px;
}
.route-canvas-wrapper {
  position: relative;
  min-height: 620px;
  background: rgba(20,28,40,.95);
  border-radius: 22px;
  padding: 0;
  border: 1px solid rgba(24,33,47,.14);
  overflow: hidden;
}
.route-drawflow {
  position: relative;
  width: 100%;
  height: 620px;
  border-radius: 22px;
  background:
    radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px) 0 0/22px 22px,
    linear-gradient(180deg, #161e2c 0%, #1c2638 100%);
}
.route-canvas-toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(20,28,40,.78);
  border: 1px solid rgba(255,255,255,.08);
  z-index: 10;
}
.route-canvas-toolbar button {
  min-width: 52px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.route-canvas-toolbar [data-zoom-display] { font-variant-numeric: tabular-nums; min-width: 64px; }
.route-canvas-toolbar button:hover { background: rgba(255,255,255,.18); }
.route-canvas-hint {
  position: absolute;
  bottom: 12px;
  left: 16px;
  font-size: 12px;
  color: rgba(244,231,208,.65);
  background: rgba(20,28,40,.6);
  padding: 4px 10px;
  border-radius: 8px;
  z-index: 10;
  pointer-events: none;
}
#drawflow .drawflow-node {
  background: transparent;
  border: none;
  padding: 0;
  min-width: 220px;
  width: auto;
  color: #1c2638;
  box-shadow: none;
}
#drawflow .drawflow-node.selected {
  background: transparent;
  border: none;
  box-shadow: none;
}
#drawflow .drawflow-node.selected .route-node {
  box-shadow: 0 0 0 2px rgba(228,182,104,.85), 0 12px 28px rgba(0,0,0,.32);
}
#drawflow .drawflow-node .input,
#drawflow .drawflow-node .output {
  width: 14px;
  height: 14px;
  border: 2px solid #f5f0e6;
  background: #2c3a55;
}
#drawflow .drawflow-node .outputs .output:nth-child(1) { background: #3aab63; }
#drawflow .drawflow-node .outputs .output:nth-child(2) { background: #cc3a3a; }
#drawflow .connection .main-path { stroke: rgba(244,231,208,.55); stroke-width: 2.2; }
#drawflow .connection .main-path.selected { stroke: #e4b668; }
.route-node {
  background: #fffdf7;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(24,33,47,.1);
  box-shadow: 0 10px 22px rgba(15,22,33,.18);
  min-width: 220px;
}
.route-node-trigger { background: linear-gradient(150deg, #f7e3bf 0%, #efd29d 100%); }
.route-node-destination[data-mode="fallback"] { background: linear-gradient(150deg, #fde9d6 0%, #f8d4af 100%); }
.route-node-delay { background: linear-gradient(150deg, #dde7f8 0%, #c8d4ee 100%); }
.route-node-outcome[data-tone="failure"] { background: linear-gradient(150deg, #f5d4d4 0%, #ebb1b1 100%); }
.route-node-outcome[data-tone="success"] { background: linear-gradient(150deg, #d5ecdc 0%, #b6ddc4 100%); }
.route-node-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.route-node-kicker { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: rgba(24,33,47,.6); }
.route-node-head strong { font-size: 15px; }
.route-node-body { font-size: 13px; line-height: 1.4; }
.route-node-body ul { margin: 4px 0 0; padding-left: 18px; }
.route-node-body small.muted { color: rgba(24,33,47,.55); }
.route-inspector strong { font-size: 14px; }
.route-inspector-section { display: flex; flex-direction: column; gap: 10px; }
.route-inspector-section label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.route-inspector-list { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: rgba(24,33,47,.04); border-radius: 12px; }
.route-inspector-list strong { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: rgba(24,33,47,.6); }
.route-inspector .danger { margin-top: 6px; }
.route-form-actions { display: flex; gap: 12px; align-items: center; }

@media (max-width: 1180px) {
  .route-inspector-columns { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .route-meta-bar { grid-template-columns: 1fr; }
  .route-palette-bar { flex-direction: column; align-items: stretch; }
  .route-palette-bar-hint { margin-left: 0; }
}

/* ── Entity action dialogs (edit / delete / restore) ───────────────────── */
.entity-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0;
  width: min(520px, 92vw);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.entity-dialog::backdrop { background: rgba(21, 32, 51, .45); backdrop-filter: blur(2px); }
.entity-dialog form { padding: 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .9rem; }
.entity-dialog h3 { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-size: 1.25rem; color: var(--ink); }
.entity-dialog .dialog-hint { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.entity-dialog label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.entity-dialog label.check-inline { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; color: var(--ink); }
.entity-dialog textarea,
.entity-dialog input[type="text"],
.entity-dialog input[type="email"],
.entity-dialog select { width: 100%; box-sizing: border-box; }
.entity-dialog textarea { min-height: 64px; resize: vertical; }
.entity-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin: .4rem 0 0; padding: 0; }
.entity-dialog .cascade-box { background: var(--gold-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem .85rem; display: flex; flex-direction: column; gap: .5rem; }

.entity-actions-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
/* Low-emphasis pill actions on detail headers — compact, calm, on-brand */
.entity-actions-row .button-secondary,
.entity-actions-row .button-danger {
  min-height: 0;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  box-shadow: none;
}
/* "Удалить" is a quiet outline action, visually detached from "Редактировать"
   so it can't be hit by accident */
.entity-actions-row .button-danger {
  margin-left: .85rem;
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red-soft);
}
.entity-actions-row .button-danger:hover { background: var(--red-soft); border-color: var(--red); transform: none; }

.deleted-banner { background: var(--red-soft); border: 1px solid var(--red-soft); color: var(--red); border-radius: var(--radius-sm); padding: .75rem .95rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

.list-tabs { display: flex; gap: .5rem; margin-bottom: .9rem; }
.list-tabs a { padding: .4rem .95rem; border-radius: 999px; font-size: .82rem; font-weight: 600; text-decoration: none; border: 1px solid var(--line); color: var(--ink-soft); background: rgba(21, 32, 51, 0.03); transition: .18s ease; }
.list-tabs a:hover { background: rgba(21, 32, 51, 0.07); }
.list-tabs a.active { background: linear-gradient(135deg, #162133, #31405e); color: #fffdf8; border-color: rgba(21, 32, 51, 0.08); }

/* ── Bulk select toolbar on list pages ─────────────────────────────────── */
/* Hidden until at least one row is selected (toggled by entity-actions.js) */
.bulk-bar { display: none; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(21,32,51,.03); margin: 0 0 .7rem; }
.bulk-bar.is-visible { display: flex; }
.bulk-bar .muted { font-size: .82rem; }
.bulk-bar [data-bulk-submit], .bulk-bar [data-bulk-delete-open] { min-height: 0; padding: 5px 12px; font-size: .8rem; border-radius: 999px; }
th.bulk-col, td.bulk-col { width: 34px; text-align: center; padding-left: 10px; padding-right: 0; }
td.bulk-col input, th.bulk-col input { width: 16px; height: 16px; cursor: pointer; }

/* ── Collapsible cards (source form: required fields, mapping) ─────────────── */
.collapse-card > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem;
  font-family: 'Playfair Display', Georgia, serif; font-size: 1.02rem; font-weight: 600; color: var(--ink);
}
.collapse-card > summary::-webkit-details-marker { display: none; }
.collapse-card > summary::before { content: '▸'; color: var(--gold); font-size: .9em; transition: transform .15s ease; }
.collapse-card[open] > summary::before { transform: rotate(90deg); }
.collapse-card > summary:hover { color: var(--gold); }
.collapse-card > *:not(summary) { margin-top: .7rem; }

/* ── Destination HTTP-node builder ─────────────────────────────────────── */
.dest-card { width: 100%; margin: 0; padding: 16px 18px; border: 1px solid rgba(24, 33, 47, 0.08); border-radius: 16px; background: rgba(255, 255, 255, 0.54); }
.dest-card > .dest-card-title { display: block; font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.dest-card > .dest-card-title + .helper-copy { margin-top: 4px; }
/* inline checkbox+label rows (avoid base label flex-direction:column centering) */
label.check-inline { flex-direction: row; align-items: center; gap: .5rem; }
label.check-inline input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--gold); }
.dest-toggle { display: flex; flex-direction: row; align-items: center; gap: .6rem; margin: 0; cursor: pointer; font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.dest-toggle input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--gold); }
.dest-subhead { font-weight: 600; font-size: .9rem; color: var(--ink-soft); margin: 2px 0 -4px; }
.dest-palette-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem; margin-bottom: .5rem; }
.dest-palette-group .dest-palette-label { color: var(--ink-soft); font-size: .8rem; min-width: 96px; }
.dest-chip { font-size: .78rem; padding: .22rem .6rem; min-height: 0; border-radius: 999px; }
.dest-kv-row { display: flex; gap: .5rem; align-items: center; }
.dest-kv-row > input { flex: 1; }
.dest-kv-row > input.dest-kv-value { flex: 2; }
.dest-kv-del { padding: 0 .55rem; min-height: 36px; flex: 0 0 auto; }
.dest-token-wrap { border-left: 3px solid var(--gold); padding-left: 14px; }

/* draggable receiver chips in base-exclusion preview */
.excl-recv-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem; margin: 0 .2rem .2rem 0; border: 1px solid rgba(24,33,47,.14); border-radius: 999px; background: var(--gold-soft, #f3ead7); font-size: .78rem; cursor: grab; user-select: none; }
.excl-recv-chip:active { cursor: grabbing; }
.excl-recv-chip::before { content: '⠿'; color: #9ca3af; font-size: .8em; }
[data-ex="exclude"].excl-drop-hover { outline: 2px dashed var(--gold); outline-offset: 2px; border-radius: 8px; }

/* ── Lead card field groups ────────────────────────────────────────────── */
.details .details-group dt {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: .95rem; font-weight: 600; color: var(--ink);
  padding-top: .5rem; border-top: 1px solid var(--line); margin-top: .35rem;
}
.details .details-group dd { border-top: 1px solid var(--line); margin-top: .35rem; }
