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

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e6e9f2;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --sidebar: #2D3748;
  --sidebar-hover: #1A202C;
  --sidebar-text: #aeb8e0;
  --sidebar-muted: #5e6aa0;
  --brand: #50738C;
  --brand-700: #3f5c70;
  --brand-soft: #edf4f7;
  --green: #16a34a;
  --green-soft: #e9f9ef;
  --cyan: #0891b2;
  --cyan-soft: #e6f7fb;
  --amber: #d97706;
  --amber-soft: #fef4e6;
  --orange: #ea580c;
  --orange-soft: #fff1e8;
  --red: #dc2626;
  --red-soft: #fdecec;
  --purple: #7c3aed;
  --purple-soft: #f1ebfe;
  --shadow: 0 10px 28px rgba(15, 23, 42, .05);
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  min-width: 1180px;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: #cdd4e4;
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.app-shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 260px;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-title,
.status-pill,
.plan-pill {
  display: none;
}

.topbar-search {
  width: min(430px, 42vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 500;
}

.topbar-search kbd {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 650;
}

.search-icon {
  color: var(--muted-2);
  font-size: 18px;
  line-height: 1;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-version {
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.topbar-icon,
.topbar .ghost.tiny {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  box-shadow: none;
  font-size: 13px;
  font-weight: 650;
}

.topbar-icon:hover,
.topbar .ghost.tiny:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.topbar-user {
  margin-left: 6px;
  text-align: right;
  line-height: 1.1;
}

.topbar-user strong {
  display: block;
  max-width: 210px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  color: #F1F5F9;
  font-size: 13px;
  font-weight: 800;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: 260px;
  padding: 16px 12px 24px;
  overflow-y: auto;
  background: var(--sidebar);
  color: #cdd5f0;
}

.office-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 18px;
  color: #F1F5F9;
  font-weight: 800;
}

.office-sidebar-logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #ffffff;
  color: #ffffff;
  font-size: 18px;
}

.office-sidebar-brand strong {
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
}

.office-sidebar-brand strong span {
  margin-left: 2px;
  color: #8ea2ff;
}

.workspace-card,
.path-card {
  display: none;
}

.phase-list,
.menu-section {
  display: grid;
  gap: 2px;
  margin: 0;
}

.section-title {
  margin: 18px 0 8px;
  padding: 0 12px;
  color: var(--sidebar-muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.phase-link,
.menu-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sidebar-text);
  text-align: left;
  transition: background .16s ease, color .16s ease;
}

.phase-link:hover,
.menu-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.phase-link.active,
.menu-item.active {
  background: #1A202C;
  color: #ffffff;
}

.phase-link.active *,
.menu-item.active * {
  color: #ffffff;
  fill: #ffffff;
  stroke: currentColor;
}

.phase-link strong,
.menu-item strong {
  display: block;
  color: #F1F5F9;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.15;
}

.phase-link small,
.menu-item small {
  display: block;
  margin-top: 2px;
  color: rgba(174, 184, 224, .82);
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.18;
}

.phase-link.active small,
.menu-item.active small {
  color: rgba(255, 255, 255, .82);
}

.num-dot,
.mini-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 800;
}

.phase-link.active .num-dot,
.menu-item.active .num-dot,
.phase-link.active .mini-icon,
.menu-item.active .mini-icon {
  background: rgba(255, 255, 255, .16);
  color: #ffffff;
}

.instance-dot {
  margin: 18px 12px 0;
  color: #8ea2ff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
}

.main {
  min-height: 100vh;
  margin-left: 260px;
  padding: 90px 24px 44px;
  background: var(--bg);
  color: var(--text);
}

.content {
  max-width: none;
  padding: 0;
}

.page-header,
.header-card,
.roadmap-hero {
  margin: 0 0 18px;
}

.page-header,
.header-card,
.selected-tool {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.page-header h1,
.content h1,
.roadmap-hero h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.1;
}

.page-header p,
.content > p,
.roadmap-hero p,
.muted {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.panel,
.module-card,
.agent-card,
.proposal-card,
.proposal-browser,
.proposal-detail,
.proposal-preview,
.calculator-card,
.chart-card,
.metric,
.table-card,
.message-card,
.form-card,
.workflow-canvas,
.business-plan,
.process-card,
.finish-card,
.scout-panel,
.skill-card,
.logo-card,
.crm-nav,
.crm-stage,
.crm-frame-wrap,
.selected-tool,
.connection-card,
.connection-detail,
.client-form-card,
.client-side-panel,
.client-empty-state,
.ai-panel,
.analysis-panel,
.n8n-gpt-card,
.n8n-chat-panel,
.autopilot-grid > article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  box-shadow: var(--shadow);
}

.panel,
.module-card,
.agent-card,
.proposal-card,
.skill-card,
.connection-card,
.client-form-card,
.client-side-panel,
.n8n-gpt-card,
.n8n-chat-panel {
  padding: 18px;
}

.module-grid,
.metric-grid,
.proposal-grid,
.agent-grid,
.skill-grid,
.autopilot-grid,
.connections-layout,
.lead-results,
.analysis-results,
.name-grid,
.choice-grid {
  display: grid;
  gap: 16px;
}

.module-grid,
.agent-grid,
.skill-grid,
.proposal-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

.lead-results {
  max-width: 1540px;
  margin: 0 auto;
  align-content: start;
}

.lead-results-head {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
}

.lead-results-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.lead-results-head p {
  margin: 0;
  color: var(--muted);
}

.lead-results-head span {
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lead-table {
  display: grid;
  gap: 10px;
}

.lead-row {
  display: grid;
  grid-template-columns: 82px minmax(230px, 1.25fr) minmax(220px, 1fr) minmax(250px, 1.15fr) minmax(300px, 1.55fr);
  gap: 18px;
  align-items: start;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lead-row.head {
  padding: 9px 16px;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.lead-row > span {
  min-width: 0;
}

.lead-score {
  display: inline-flex;
  width: fit-content;
  min-width: 58px;
  justify-content: center;
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.lead-score.hot {
  background: var(--green-soft);
  color: var(--green);
}

.lead-score.warm {
  background: #fff7ed;
  color: #c2410c;
}

.lead-score.cold {
  background: #f1f5f9;
  color: var(--muted);
}

.lead-company,
.lead-contact,
.lead-address,
.lead-detail {
  display: grid;
  gap: 7px;
  line-height: 1.45;
}

.lead-company strong,
.lead-contact strong {
  overflow-wrap: anywhere;
}

.lead-link,
.lead-contact small,
.lead-address small,
.lead-autos {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.lead-link {
  color: var(--brand);
  font-weight: 750;
  text-decoration: none;
}

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

.lead-address {
  overflow-wrap: anywhere;
}

.lead-signals {
  display: block;
  color: var(--text);
  font-style: normal;
  overflow-wrap: anywhere;
}

.lead-autos {
  display: block;
}

.content.split,
.roadmap-calc {
  display: grid;
  grid-template-columns: minmax(520px, 1.05fr) minmax(460px, .95fr);
  gap: 24px;
  align-items: start;
}

.roadmap-calc > div:first-child,
.roadmap-calc > .metric-grid {
  min-width: 0;
}

.compact-section {
  max-width: 980px;
}

.dense-calc {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 18px 20px;
  align-items: stretch;
  padding: 22px;
}

.dense-calc .segmented,
.dense-calc .choice-grid {
  align-content: start;
}

.dense-calc .range-row {
  min-width: 0;
}

.range-row {
  min-height: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  gap: 10px 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.range-row span {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.range-row b {
  color: var(--text);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.1;
  text-align: right;
  white-space: normal;
}

.range-row input {
  grid-column: 1 / -1;
  align-self: end;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.overview-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: stretch;
}

.overview-grid .metric {
  min-height: 118px;
}

.metric {
  min-height: 112px;
  padding: 18px;
}

.metric small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 30px;
  font-weight: 850;
  line-height: 1.08;
}

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

.metric.highlight {
  border-color: rgba(80, 115, 140, .24);
  background: var(--surface);
}

.actions-row,
.footer-nav,
.chips,
.category-rack,
.segmented,
.toolbar,
.proposal-preview-head,
.skill-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.actions-row {
  justify-content: flex-end;
  margin: 14px 0;
}

.footer-nav {
  justify-content: space-between;
  margin-top: 18px;
}

.primary,
button.primary,
a.primary,
.floating-roadmap,
.preview-body button,
.actions-row .primary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  background: var(--brand);
  color: #ffffff;
  box-shadow: none;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.primary:hover,
button.primary:hover,
a.primary:hover,
.floating-roadmap:hover,
.preview-body button:hover,
.actions-row .primary:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #ffffff;
}

.ghost,
button.ghost,
a.ghost,
.segmented button,
.chips button,
.category-rack button,
.choice-grid button,
.name-grid button,
.connection-grid button,
.crm-section-tab,
.crm-subitem,
.enter-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.ghost:hover,
button.ghost:hover,
a.ghost:hover,
.segmented button:hover,
.chips button:hover,
.category-rack button:hover,
.choice-grid button:hover,
.name-grid button:hover,
.connection-grid button:hover,
.crm-section-tab:hover,
.crm-subitem:hover {
  background: var(--surface-soft);
}

.segmented button.selected,
.chips button.selected,
.category-rack button.selected,
.proposal-niche-card.selected-card,
.connection-card.active,
.tool-tile.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-700);
}

.primary.full,
.wide,
.full {
  width: 100%;
}

input,
textarea,
select,
.searchbar {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  box-shadow: none;
  font-size: 14px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
.searchbar:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(80, 115, 140, .16);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.form-grid .wide,
.client-form-grid .wide,
.field-wide {
  grid-column: 1 / -1;
}

.table-card {
  overflow: hidden;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 48px 1fr 180px;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.table-head {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.table-row {
  background: var(--surface);
}

.table-row:hover {
  background: var(--surface-soft);
}

.table-row strong small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.table-row em,
.pill,
.tag,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 10%, #ffffff);
  color: var(--brand-700);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.green,
.pill-green {
  color: var(--green);
  background: var(--green-soft);
}

.cyan,
.pill-cyan {
  color: var(--cyan);
  background: var(--cyan-soft);
}

.amber,
.yellow,
.pill-amber,
.pill-yellow {
  color: var(--amber);
  background: var(--amber-soft);
}

.orange,
.pill-orange {
  color: var(--orange);
  background: var(--orange-soft);
}

.red,
.danger,
.pill-red {
  color: var(--red);
  background: var(--red-soft);
}

.purple,
.violet,
.pill-purple,
.pill-violet {
  color: var(--purple);
  background: var(--purple-soft);
}

.blue,
.pill-blue,
.pill-indigo {
  color: var(--brand-700);
  background: var(--brand-soft);
}

.bar-chart,
.bar-chart.detailed {
  min-height: 170px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 16px 20px 0;
}

.bar-chart span,
.bar-chart.detailed span {
  flex: 1;
  min-height: 24px;
  display: block;
  position: relative;
  border-radius: 8px 8px 0 0;
  background: var(--brand);
}

.bar-chart span i,
.bar-chart.detailed span i {
  position: absolute;
  top: 6px;
  left: 7px;
  color: #ffffff;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 0 2px;
  border-top: 1px solid var(--border);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.projection-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-self: start;
}

.projection-table.compact-cards {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.projection-table div,
.projection-table article {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "month amount"
    "meta meta";
  align-items: center;
  gap: 7px 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.projection-table.compact-cards div,
.projection-table.compact-cards article {
  min-height: 104px;
  padding: 16px;
}

.projection-table span {
  grid-area: month;
  display: inline-flex;
  align-items: center;
  min-width: 56px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.projection-table strong {
  grid-area: amount;
  display: block;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 850;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
}

.projection-table small,
.projection-table p {
  grid-area: meta;
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.projection-table.compact-cards small,
.projection-table.compact-cards p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.chart-card.wide {
  grid-column: 1 / -1;
  padding: 18px;
}

.chart-card.wide h3 {
  margin-bottom: 10px;
}

.chart-card.wide + .projection-table {
  margin-top: 14px;
}

.roadmap-list {
  display: grid;
  gap: 10px;
}

.roadmap-row {
  width: 100%;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  text-align: left;
}

.step-index {
  color: var(--brand);
  font-size: 30px;
  font-weight: 850;
}

.proposal-layout,
.lead-layout,
.client-layout,
.connections-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.proposal-detail,
.lead-panel {
  padding: 18px;
}

.proposal-niche-card,
.agent-card,
.skill-card,
.connection-card,
.tool-tile,
.lead-pick {
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.client-side-panel {
  display: grid;
  gap: 16px;
}

.client-side-panel h3 {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.client-automation-grid {
  max-height: 380px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding-right: 4px;
}

.proposal-detail .client-automation-grid,
.client-side-panel .client-automation-grid {
  grid-template-columns: 1fr;
}

.client-layout .client-automation-grid,
.proposal-preview .client-automation-grid,
.business-plan .client-automation-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.client-automation-grid button,
.automation-option {
  width: 100%;
  min-height: 64px;
  height: auto;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.client-automation-grid button:hover,
.automation-option:hover {
  background: var(--surface-soft);
}

.client-automation-grid button.selected,
.client-automation-grid button.active,
.automation-option.active {
  border-color: var(--cyan);
  background: var(--cyan-soft);
  color: var(--text);
}

.client-automation-grid button strong,
.automation-option strong {
  display: block;
  width: 100%;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.18;
  white-space: normal;
  overflow-wrap: anywhere;
}

.client-automation-grid button span,
.automation-option span {
  display: block;
  width: 100%;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.client-automation-grid button small,
.automation-option small {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.client-budget-box,
.budget-band {
  display: grid;
  gap: 5px;
  max-width: 520px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.client-budget-box span,
.budget-band small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.client-budget-box strong,
.budget-band strong {
  color: var(--text);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.15;
}

.client-budget-box small,
.budget-band span {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.proposal-niche-card span,
.agent-card > div span,
.skill-card span {
  color: var(--brand);
  font-weight: 800;
}

.proposal-niche-card strong,
.agent-card h3,
.skill-card h3,
.module-card h3,
.process-card h3 {
  display: block;
  margin: 8px 0 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.proposal-niche-card small,
.agent-card p,
.skill-card p,
.module-card p,
.process-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.agent-card a,
.agent-card button.ghost,
.skill-actions .ghost {
  width: fit-content;
  color: var(--brand);
}

.lead-table {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* Office phase 2, 3 and 4: spacious browser + readable side panel */
.proposal-workspace,
.niche-analyzer,
.lead-workspace {
  max-width: 1560px;
  margin: 0 auto;
}

.proposal-workspace .proposal-layout,
.niche-analyzer .proposal-layout,
.lead-workspace .proposal-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 24px;
}

.proposal-browser {
  max-width: 1120px;
  padding: 22px;
  border-radius: 18px;
}

.proposal-browser .category-rack,
.proposal-browser .chips {
  gap: 10px;
  margin-bottom: 18px;
}

.proposal-browser .category-rack button,
.proposal-browser .chips button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
}

.proposal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.proposal-toolbar strong {
  font-size: 16px;
  font-weight: 850;
}

.proposal-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.proposal-workspace .proposal-grid,
.niche-analyzer .proposal-grid,
.lead-workspace .proposal-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-height: min(66vh, 760px);
  overflow: auto;
  padding: 2px 8px 2px 2px;
}

.proposal-niche-card {
  min-height: 146px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.proposal-niche-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand) 32%, var(--border));
  background: #ffffff;
}

.proposal-niche-card span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
}

.proposal-niche-card strong {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.28;
}

.proposal-niche-card small,
.proposal-niche-card em {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-style: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.proposal-detail,
.analysis-panel,
.lead-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 18px;
}

.proposal-detail h3,
.analysis-panel h3,
.lead-panel h3 {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.proposal-score {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
}

.proposal-score > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 850;
}

.proposal-insight {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.need-list,
.lead-chip-list,
.automation-list {
  display: grid;
  gap: 10px;
}

.need-list,
.lead-chip-list {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.lead-filter-field {
  display: grid;
  gap: 7px;
}

.lead-filter-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.need-pill,
.lead-chip-list span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12.5px;
  font-weight: 750;
  text-align: center;
}

/* Phase 8: n8n builder */
.n8n-builder-layout {
  max-width: 1480px;
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.n8n-gpt-card,
.n8n-chat-panel {
  border-radius: 18px;
  padding: 24px;
}

.n8n-gpt-card {
  display: grid;
  gap: 18px;
  align-content: start;
}

.n8n-gpt-card span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}

.n8n-gpt-card h2 {
  font-size: 24px;
  line-height: 1.1;
}

.n8n-gpt-card p {
  color: var(--muted);
  line-height: 1.6;
}

.n8n-checklist {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.n8n-checklist small {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.n8n-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto auto;
  gap: 16px;
}

.n8n-chat-log {
  min-height: 360px;
  max-height: 540px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.n8n-message {
  max-width: 82%;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
}

.n8n-message.user {
  justify-self: end;
  background: var(--brand-soft);
}

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

.n8n-starters button {
  height: auto;
  min-height: 72px;
  justify-content: flex-start;
  text-align: left;
  line-height: 1.35;
}

.n8n-chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

/* Phase 9: Codex skills rebuilt */
.codex-skills-page {
  max-width: 1480px;
  margin: 0 auto;
}

.skills-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 24px;
}

.skills-toolbar,
.skill-preview {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.skills-toolbar {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 20px;
}

.skills-toolbar .chips {
  display: grid;
  grid-template-columns: 1fr;
}

.skills-toolbar .chips button {
  width: 100%;
  justify-content: flex-start;
  min-height: 42px;
}

.skill-preview {
  min-height: 280px;
  padding: 24px;
}

.skill-preview-empty {
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(80, 115, 140, .12), transparent 28%),
    var(--surface);
}

.skill-preview-empty > div {
  max-width: 620px;
  display: grid;
  gap: 12px;
}

.skill-preview-head {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
}

.skill-preview-head img {
  width: 180px;
  height: 112px;
  border-radius: 16px;
  object-fit: cover;
  filter: brightness(.72) saturate(.68);
}

.skill-preview-head h2 {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.12;
}

.skill-markdown {
  margin-top: 22px;
  padding: 22px;
  border-radius: 16px;
  background: var(--surface-soft);
  line-height: 1.65;
}

.codex-skills-page .skill-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.skill-card {
  position: relative;
  min-height: 320px;
  display: grid;
  grid-template-rows: 132px auto auto 1fr auto;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  height: 132px;
  z-index: 1;
  pointer-events: none;
  border-radius: 14px;
  background: rgba(15, 23, 42, .34);
}

.skill-image {
  width: 100%;
  height: 132px;
  border-radius: 14px;
  object-fit: cover;
  filter: brightness(.78) saturate(.62);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tags small {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-700);
  font-weight: 750;
}

/* Phase 5: personalized client proposals rebuilt */
.client-workspace,
.content:has(.client-proposal-layout) {
  max-width: 1480px;
  margin: 0 auto;
}

.client-proposal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 24px;
  align-items: start;
}

.client-form-card,
.client-primary-panel,
.client-side-panel,
.client-control-panel,
.client-empty-state {
  border-radius: 18px;
}

.client-form-card,
.client-primary-panel {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.client-form-card > .section-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: -8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-700);
}

.client-form-card > .section-kicker::after {
  content: " - informacion comercial";
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

.client-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.client-form-grid .client-field {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.client-form-grid .client-field.full,
.client-form-grid .client-field:has(textarea) {
  grid-column: span 2;
}

.client-form-grid .client-field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.client-form-grid .client-field input,
.client-form-grid .client-field select,
.client-form-grid .client-field textarea {
  border-radius: 12px;
  background: var(--surface);
}

.client-form-grid .client-field textarea {
  min-height: 118px;
  line-height: 1.5;
}

.client-form-grid .client-field.full:last-child textarea,
.client-form-grid label:last-child textarea {
  min-height: 180px;
}

.client-upload {
  min-height: 96px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px dashed color-mix(in srgb, var(--brand) 38%, var(--border));
  border-radius: 16px;
  background: var(--brand-soft);
  cursor: pointer;
}

.client-upload input {
  grid-column: 1 / -1;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

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

.file-list span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.client-side-panel,
.client-control-panel {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 18px;
  padding: 22px;
}

.client-side-panel > .section-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--cyan-soft);
  color: var(--cyan);
}

.client-side-panel .client-automation-grid {
  max-height: 520px;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-right: 6px;
}

.client-side-panel .client-automation-grid button {
  min-height: 88px;
  padding: 16px;
  border-radius: 15px;
}

.client-side-panel .client-automation-grid button strong {
  font-size: 15px;
}

.client-side-panel .client-automation-grid button span {
  color: var(--brand-700);
}

.client-budget-box {
  max-width: none;
  gap: 8px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-soft), #ffffff);
}

.lead-pick-list {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.lead-pick-list .lead-pick {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
}

.client-empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 36px;
  text-align: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(80, 115, 140, .12), transparent 30%),
    var(--surface);
}

.client-empty-state h3 {
  font-size: 24px;
}

.client-empty-state p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.6;
}

.client-proposal-layout + .proposal-preview,
.client-proposal-layout + .client-empty-state {
  max-width: 1480px;
}

/* Point 10: Workflows */
.office-workflows-page {
  max-width: 1540px;
  margin: 0 auto;
}

.workflow-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.workflow-hero > div:first-child,
.workflow-stats,
.workflow-controls,
.workflow-feature-card,
.workflow-library-card,
.workflow-empty {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(15, 23, 42, .06);
}

.workflow-hero > div:first-child {
  padding: 28px;
}

.workflow-hero span,
.workflow-feature-card > span,
.workflow-card-body > span,
.workflow-modal-head span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workflow-hero h2 {
  margin: 8px 0 10px;
  color: var(--text);
  font-size: 34px;
  line-height: 1.08;
}

.workflow-hero p,
.workflow-feature-card p,
.workflow-library-card p,
.workflow-empty p,
.workflow-modal-head p,
.workflow-modal-section p {
  color: var(--muted);
  line-height: 1.65;
}

.workflow-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.workflow-stats article {
  display: grid;
  place-content: center;
  min-height: 118px;
  border-radius: 16px;
  background: var(--surface-soft);
  text-align: center;
}

.workflow-stats strong {
  color: var(--text);
  font-size: 32px;
  line-height: 1;
}

.workflow-stats small,
.workflow-card-meta small,
.workflow-detail-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.workflow-controls {
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-bottom: 22px;
}

.workflow-controls input {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 16px;
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
}

.workflow-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workflow-categories button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.workflow-categories button.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.workflow-featured {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.workflow-feature-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.workflow-feature-card h3,
.workflow-library-card h3,
.workflow-modal-head h2 {
  color: var(--text);
  line-height: 1.2;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 18px;
}

.workflow-library-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.workflow-card-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.workflow-card-meta,
.workflow-card-actions,
.workflow-modal-actions,
.workflow-chip-line,
.workflow-node-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.workflow-card-meta small,
.workflow-chip-line span,
.workflow-node-list span {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
}

.workflow-card-actions {
  justify-content: space-between;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
}

.workflow-card-actions .ghost,
.workflow-modal-actions .ghost,
.workflow-modal-actions .primary {
  min-width: 150px;
  text-align: center;
}

.workflow-visual {
  min-height: 132px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(80, 115, 140, .10), rgba(34, 197, 94, .08)),
    var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.workflow-feature-card .workflow-visual {
  border: 1px solid var(--border);
  border-radius: 16px;
}

.workflow-visual span {
  position: relative;
  min-width: 92px;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 12px 10px;
  border: 1px solid rgba(80, 115, 140, .24);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
}

.workflow-visual span:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(100% + 2px);
  top: 50%;
  width: 24px;
  height: 2px;
  background: var(--brand);
  opacity: .55;
}

.workflow-visual b {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
}

.workflow-visual small {
  max-width: 84px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.workflow-empty {
  padding: 28px;
  text-align: center;
}

.workflow-detail-card {
  width: min(1280px, 96vw);
  max-height: 92vh;
}

.workflow-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.workflow-detail-card .workflow-visual {
  min-height: 180px;
  border-bottom: 1px solid var(--border);
}

.workflow-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 24px;
}

.workflow-detail-grid section {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.workflow-detail-grid strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.workflow-modal-section {
  display: grid;
  gap: 12px;
  margin: 0 24px 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.workflow-modal-section h3 {
  color: var(--text);
}

.workflow-loading {
  margin: 0 24px 18px;
  color: var(--muted);
  font-weight: 800;
}

.workflow-modal-actions {
  justify-content: flex-end;
  padding: 18px 24px 24px;
  border-top: 1px solid var(--border);
}

.lead-table table,
.proposal-table,
table {
  width: 100%;
  border-collapse: collapse;
}

.lead-table th,
.lead-table td,
.proposal-table th,
.proposal-table td,
th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.lead-table th,
.proposal-table th,
th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.lead-table tr:hover,
.proposal-table tr:hover,
tbody tr:hover {
  background: var(--surface-soft);
}

.ai-panel {
  overflow: hidden;
}

.ai-panel > div:first-child,
.panel-head,
.proposal-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.ai-panel textarea {
  min-height: 320px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ai-error,
.auth-feedback.error {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 44vw) 1fr;
  background: var(--bg);
}

.auth-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  background: var(--sidebar);
  color: #ffffff;
}

.auth-hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-hero-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
}

.auth-hero-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.auth-hero-brand span,
.auth-hero-brand p,
.auth-hero-copy p,
.auth-hero-note {
  color: rgba(255, 255, 255, .72);
}

.auth-hero-copy h1 {
  max-width: 560px;
  color: #ffffff;
  font-size: 42px;
  font-weight: 850;
  letter-spacing: -.02em;
  line-height: 1.08;
}

.auth-form-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px;
}

.auth-panel {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .12);
}

.auth-brand {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.auth-brand img {
  width: 180px;
}

.auth-brand span {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-brand h1 {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.auth-brand p {
  color: var(--muted);
  font-size: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.auth-tabs button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
}

.auth-tabs button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-divider {
  height: 1px;
  background: var(--border);
}

.auth-feedback {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.auth-feedback.ok {
  background: var(--green-soft);
  color: var(--green);
}

.modal,
.workflow-modal,
.agent-modal,
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(2px);
}

.modal-card,
.workflow-modal-card,
.agent-modal-card {
  width: min(1120px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
}

.workflow-modal-card img,
.image-modal img {
  max-height: 80vh;
  object-fit: contain;
}

#lead-xls[disabled],
#lead-xls:disabled,
button[disabled],
.primary[disabled],
.ghost[disabled] {
  cursor: not-allowed;
  opacity: .55;
}

@media (max-width: 1420px) {
  .content.split,
  .roadmap-calc {
    grid-template-columns: 1fr;
  }

  .compact-section {
    max-width: none;
  }

  .overview-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }

  .proposal-workspace .proposal-grid,
  .niche-analyzer .proposal-grid,
  .lead-workspace .proposal-grid,
  .codex-skills-page .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .n8n-builder-layout,
  .skills-shell {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .sidebar {
    width: 220px;
  }

  .topbar {
    left: 220px;
  }

  .main {
    margin-left: 220px;
  }

  .proposal-layout,
  .lead-layout,
  .client-layout,
  .client-proposal-layout,
  .connections-shell {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .overview-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .projection-table,
  .projection-table.compact-cards {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .dense-calc {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .proposal-workspace .proposal-layout,
  .niche-analyzer .proposal-layout,
  .lead-workspace .proposal-layout {
    grid-template-columns: 1fr;
  }

  .proposal-browser {
    max-width: none;
  }

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

  .workflow-hero > div:first-child {
    grid-column: 1 / -1;
  }

  .client-side-panel {
    position: static;
  }

  .n8n-starters {
    grid-template-columns: 1fr;
  }

  .skill-preview-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .auth-screen {
    display: block;
  }

  .auth-hero {
    min-height: auto;
    padding: 28px 20px;
    gap: 36px;
  }

  .auth-form-wrap {
    min-height: auto;
    padding: 28px 16px;
  }

  .metric-grid,
  .overview-grid,
  .projection-table,
  .projection-table.compact-cards,
  .dense-calc,
  .form-grid,
  .client-form-grid {
    grid-template-columns: 1fr;
  }

  .proposal-workspace .proposal-grid,
  .niche-analyzer .proposal-grid,
  .lead-workspace .proposal-grid,
  .client-proposal-layout,
  .workflow-hero,
  .workflow-featured,
  .workflow-grid,
  .workflow-stats,
  .workflow-detail-grid,
  .codex-skills-page .skill-grid,
  .skills-toolbar .chips,
  .n8n-chat-input {
    grid-template-columns: 1fr;
  }

  .client-form-grid .client-field,
  .client-form-grid .client-field.full,
  .client-form-grid .client-field:has(textarea) {
    grid-column: 1 / -1;
  }
}

/* Final Office CRM-ERP alignment: clean layout, readable type and repaired dense sections */
html,
body,
#root,
button,
input,
textarea,
select,
option {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0;
}

.topbar-search .search-icon {
  min-width: auto;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.phase-link,
.menu-item {
  min-height: 58px;
  align-items: center;
}

.phase-link > span:last-child,
.menu-item > span:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.phase-link strong,
.menu-item strong {
  display: block;
  color: #F1F5F9;
  font-size: 14px;
  line-height: 1.18;
  white-space: normal;
  overflow-wrap: anywhere;
}

.phase-link small,
.menu-item small {
  display: block;
  color: rgba(226, 232, 255, .72);
  font-size: 12px;
  line-height: 1.18;
  white-space: normal;
  overflow-wrap: anywhere;
}

.phase-link.active strong,
.menu-item.active strong,
.phase-link.active small,
.menu-item.active small {
  color: #ffffff;
}

.roadmap-row {
  min-height: 78px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.roadmap-row strong {
  display: block;
  margin-bottom: 4px;
  line-height: 1.2;
}

.roadmap-row small,
.roadmap-row span:not(.step-index) {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.client-proposal-layout {
  max-width: 1480px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 430px);
  gap: 32px;
  align-items: start;
}

.client-form-card,
.client-primary-panel,
.client-side-panel,
.client-control-panel {
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.client-form-card,
.client-primary-panel {
  padding: 28px;
}

.client-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 22px;
}

.client-form-grid .client-field {
  min-height: 112px;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px;
  border: 1px solid #e3e8f4;
  border-radius: 18px;
  background: #f8fafc;
}

.client-form-grid .client-field.full,
.client-form-grid .client-field:has(textarea) {
  grid-column: 1 / -1;
}

.client-form-grid .client-field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
}

.client-form-grid .client-field input,
.client-form-grid .client-field select,
.client-form-grid .client-field textarea,
.client-niche-select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #d8e0ee;
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.client-form-grid .client-field textarea {
  min-height: 130px;
  padding: 14px;
  resize: vertical;
}

.client-side-panel,
.client-control-panel {
  gap: 20px;
  padding: 24px;
}

.client-side-panel .client-automation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-height: 560px;
  overflow: auto;
  padding-right: 8px;
}

.client-side-panel .client-automation-grid button {
  min-height: 100px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #dde5f1;
  background: var(--surface);
}

.client-side-panel .client-automation-grid button.selected {
  border-color: var(--cyan);
  background: var(--cyan-soft);
}

.client-side-panel .client-automation-grid button strong {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.28;
}

.client-side-panel .client-automation-grid button span,
.client-side-panel .client-automation-grid button small {
  line-height: 1.35;
}

.client-budget-box {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid #d8e0ee;
  background: #f8fafc;
}

.client-budget-box strong {
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.18;
}

.connections-shell {
  max-width: 1500px;
  margin: 0 auto;
  display: block;
}

.connections-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.connections-overview article,
.connections-list-panel,
.connection-detail {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.connections-overview article {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 22px;
}

.connections-overview span,
.connection-panel-head small,
.connection-detail-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.connections-overview strong {
  color: var(--text);
  font-size: 34px;
  line-height: 1;
}

.connections-overview small {
  color: var(--muted);
  font-size: 13px;
}

.connections-workspace {
  display: grid;
  grid-template-columns: minmax(420px, .9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
}

.connections-list-panel,
.connection-detail {
  padding: 24px;
}

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

.connection-panel-head h2,
.connection-detail-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.connection-panel-head > span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 850;
}

.connection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.connection-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(112px, max-content);
  gap: 14px 22px;
  align-items: start;
  padding: 20px 24px;
  text-align: left;
  border-radius: 18px;
}

.connection-card .connection-status {
  grid-column: auto;
  justify-self: end;
  align-self: start;
  white-space: nowrap;
}

.connection-card-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
  justify-items: start;
  text-align: left;
}

.connection-card-copy strong,
.connection-card-copy small {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.connection-card-copy strong {
  font-size: 15.5px;
}

.connection-card-copy small {
  font-size: 12px;
}

.connections-list-panel .connection-card {
  width: 100%;
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr) 150px;
  justify-content: stretch;
  justify-items: stretch;
  column-gap: 28px;
}

.connections-list-panel .connection-card .connection-icon {
  justify-self: start;
}

.connections-list-panel .connection-card .connection-card-copy {
  width: 100%;
}

.connections-list-panel .connection-card .connection-status {
  justify-self: end;
  text-align: right;
}

.connection-detail-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
}

.connection-detail-head p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.connection-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.connection-field {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #e3e8f4;
  border-radius: 16px;
  background: #f8fafc;
}

.connection-field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.connection-field input {
  min-height: 44px;
  border-radius: 12px;
  background: var(--surface);
}

.connection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.connection-actions .primary,
.connection-actions .ghost {
  min-height: 42px;
  padding-inline: 16px;
}

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

.connection-meta div,
.connection-help {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.connection-meta strong,
.connection-help strong {
  color: var(--text);
  font-size: 13px;
}

.connection-meta span,
.connection-help p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .client-proposal-layout,
  .connections-workspace,
  .connections-overview {
    grid-template-columns: 1fr;
  }

  .client-side-panel,
  .client-control-panel {
    position: static;
  }
}

