:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #102033;
  --muted: #66768a;
  --line: #dce5ef;
  --primary: #1268f3;
  --primary-dark: #0d47a1;
  --green: #0aa37f;
  --shadow: 0 18px 45px rgba(30, 52, 82, .09);
  --radius: 22px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #071827;
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  margin-bottom: 32px;
}
.brand span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--green));
  font-weight: 900;
}
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a {
  color: rgba(255,255,255,.78);
  padding: 12px 14px;
  border-radius: 13px;
  font-weight: 700;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.main { padding: 34px; max-width: 1280px; width: 100%; }
.hero {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 26px;
  align-items: stretch;
  margin-bottom: 28px;
  padding: 38px;
  color: #fff;
  border-radius: 30px;
  background: radial-gradient(circle at 88% 10%, rgba(10,163,127,.7), transparent 28%), linear-gradient(135deg, #071827, #123f7a);
  box-shadow: var(--shadow);
}
.hero h1, .page-title h1 { margin: 0 0 14px; font-size: clamp(32px, 5vw, 58px); line-height: 1.08; }
.hero p { color: rgba(255,255,255,.82); max-width: 760px; }
.eyebrow { color: var(--green); font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.hero .eyebrow { color: #8ef2d6; }
.hero-card {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 28px;
  border-radius: 24px;
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.22);
}
.hero-card strong { font-size: 28px; }
.hero-card span { color: rgba(255,255,255,.82); }
.grid { display: grid; gap: 22px; }
.cards { grid-template-columns: repeat(5, 1fr); margin-bottom: 28px; }
.cards.compact { grid-template-columns: repeat(4, 1fr); }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.server-strip {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(110px, auto)) 1fr;
  gap: 12px;
  align-items: center;
  margin: -10px 0 24px;
  padding: 13px 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.server-strip strong { color: var(--primary-dark); }
.server-strip span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--primary-dark);
  font-weight: 900;
  font-size: 13px;
}
.server-strip small {
  justify-self: end;
  color: var(--muted);
  font-weight: 800;
}
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 24px; color: var(--ink); }
.card span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  border-radius: 14px;
  background: var(--primary);
  font-weight: 900;
}
.card h2 { margin-bottom: 8px; }
.card p, .muted, .page-title p { color: var(--muted); }
.panel { padding: 26px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.table { display: grid; gap: 8px; }
.row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 2fr .7fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.row.head { color: var(--muted); font-weight: 800; }
.page-title { margin-bottom: 22px; }
.form { display: grid; gap: 18px; }
.form.two-col { grid-template-columns: 1fr 1fr; }
.form button { grid-column: 1 / -1; }
label { display: grid; gap: 8px; font-weight: 800; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
}
button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
  cursor: pointer;
}
button:hover { background: var(--primary-dark); }
.button-link {
  display: inline-block;
  border-radius: 999px;
  padding: 14px 22px;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
}
.button-link:hover { background: var(--primary-dark); color: #fff; }
.result-card h2 { font-size: 20px; }
.metrics, .tags { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.metrics span, .tags span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}
.prose { max-width: 900px; }
pre {
  white-space: pre-wrap;
  background: #f7fafc;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--line);
}
.quote {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.quote div {
  padding: 18px;
  border-radius: 16px;
  background: #f7fafc;
}
.quote span { display: block; color: var(--muted); }
.quote strong { display: block; margin-top: 8px; font-size: 22px; }
.timeline { display: grid; gap: 18px; }
.step {
  display: grid;
  grid-template-columns: 56px 220px 1fr;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.step span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: #fff;
  border-radius: 16px;
  background: var(--green);
  font-weight: 900;
}
.badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--primary-dark);
  font-weight: 900;
  font-size: 13px;
}
.pipeline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.pipeline span {
  padding: 12px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #edf4ff, #eafaf5);
  color: var(--primary-dark);
  font-weight: 900;
}
.pipeline.large span { padding: 14px 18px; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}
.module-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.module-card {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.module-card h2 { margin-top: 0; }
.module-card p { color: var(--muted); }
.status-grid { margin-bottom: 22px; }
.status-card strong {
  display: block;
  margin: 12px 0;
  font-size: 34px;
}
.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf4ff;
}
.meter i {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--green), var(--primary));
}
.matrix { display: grid; gap: 0; margin-top: 16px; }
.matrix-row {
  display: grid;
  grid-template-columns: 1.2fr .35fr 1fr;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}
.matrix-row.four { grid-template-columns: .8fr .7fr 1.5fr .35fr; }
.matrix-row.account {
  grid-template-columns: .9fr 1.3fr 1.6fr .55fr;
}
.matrix-row.head { color: var(--muted); font-weight: 900; }
.matrix-row strong { color: var(--green); }
.search-form {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 24px;
}
.knowledge-list { display: grid; gap: 14px; margin-top: 18px; }
.knowledge-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
}
.knowledge-item h2 { margin: 10px 0 6px; }
.knowledge-item p { margin: 0 0 8px; }
.crm-table { display: grid; gap: 0; overflow-x: auto; }
.crm-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr .8fr .8fr .9fr .9fr 1.4fr .5fr;
  gap: 12px;
  min-width: 1080px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}
.crm-row.head { color: var(--muted); font-weight: 900; }
.crm-row strong { color: var(--green); }
.crm-row small { color: var(--muted); }
.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 14px; background: #fff4e5; color: #8a4b00; }
@media (max-width: 1000px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .cards, .hero, .grid.two, .form.two-col, .quote, .step, .module-grid, .matrix-row, .search-form, .knowledge-item { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root {
    --radius: 18px;
    --shadow: 0 12px 30px rgba(30, 52, 82, .08);
  }

  body {
    display: block;
    min-width: 0;
    overflow-x: hidden;
  }

  .sidebar {
    padding: 14px 14px 12px;
    border-radius: 0 0 22px 22px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .brand span {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 17px;
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar nav a {
    flex: 0 0 auto;
    padding: 9px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    font-size: 13px;
    white-space: nowrap;
  }

  .main {
    padding: 18px 14px 30px;
    max-width: none;
  }

  .hero {
    gap: 16px;
    margin-bottom: 18px;
    padding: 24px 18px;
    border-radius: 24px;
  }

  .hero h1,
  .page-title h1 {
    font-size: clamp(28px, 9vw, 38px);
    line-height: 1.12;
  }

  .hero p,
  .page-title p {
    font-size: 15px;
  }

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

  .hero-card strong {
    font-size: 22px;
  }

  .grid,
  .cards,
  .cards.compact,
  .grid.two,
  .grid.three,
  .module-grid,
  .module-grid.two-col {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .cards {
    margin-bottom: 18px;
  }

  .card,
  .panel,
  .module-card {
    padding: 18px;
    border-radius: 18px;
  }

  .server-strip {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: -4px 0 18px;
    padding: 12px;
  }

  .server-strip strong,
  .server-strip small {
    grid-column: 1 / -1;
  }

  .server-strip small {
    justify-self: start;
  }

  .card span {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 13px;
  }

  .card h2,
  .panel h2,
  .module-card h2 {
    font-size: 20px;
  }

  .panel-head {
    display: grid;
    gap: 10px;
    align-items: start;
  }

  .panel-head .badge,
  .panel-head a {
    justify-self: start;
  }

  .form,
  .form.two-col,
  .search-form {
    grid-template-columns: 1fr;
  }

  input,
  textarea,
  select,
  button,
  .button-link {
    min-height: 46px;
    font-size: 16px;
  }

  button,
  .button-link {
    width: 100%;
    text-align: center;
  }

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

  .quote strong {
    font-size: 20px;
  }

  .step {
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: start;
    padding: 16px;
  }

  .step span {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .step p {
    grid-column: 1 / -1;
    margin: 0;
  }

  .pipeline span,
  .pipeline.large span,
  .metrics span,
  .tags span,
  .badge {
    padding: 7px 10px;
    font-size: 12px;
  }

  .matrix,
  .table,
  .crm-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .matrix-row,
  .matrix-row.four,
  .matrix-row.account,
  .row {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    min-width: 620px;
  }

  .knowledge-item {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .knowledge-item .button-link {
    width: 100%;
  }

  pre {
    max-height: 420px;
    overflow: auto;
    padding: 14px;
    font-size: 13px;
    line-height: 1.6;
  }
}

@media (max-width: 420px) {
  .main {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero {
    padding: 22px 16px;
  }

  .card,
  .panel,
  .module-card {
    padding: 16px;
  }

  .hero h1,
  .page-title h1 {
    font-size: 28px;
  }
}
