:root {
  --ink: #152235;
  --muted: #5d6b7c;
  --line: #dbe3ee;
  --soft: #f5f7fa;
  --panel: #ffffff;
  --primary: #1f3655;
  --accent: #4f8cc9;
  --accent-soft: #e9f3ff;
  --success: #277a5b;
  --warning: #b56a12;
  --shadow: 0 16px 40px rgba(21, 34, 53, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.site-header,
.app-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 6vw;
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 13px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.primary-button { background: var(--primary); color: white; }
.secondary-button { background: white; color: var(--primary); border-color: var(--line); }
.ghost-button { background: transparent; color: var(--primary); border-color: var(--line); }
.large { min-height: 48px; padding: 0 20px; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: 56px 6vw 72px;
  background:
    linear-gradient(140deg, rgba(233,243,255,0.9), rgba(255,255,255,0.9)),
    url("data:image/svg+xml,%3Csvg width='1600' height='1000' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1600' height='1000' fill='%23f7fafc'/%3E%3Cg stroke='%23dbe7f4' stroke-width='2'%3E%3Cpath d='M160 760 L520 520 L820 660 L1220 320 L1460 420' fill='none'/%3E%3Cpath d='M240 680 L520 460 L760 560 L1080 300 L1320 360' fill='none' opacity='.7'/%3E%3C/g%3E%3Cg fill='%23ffffff' stroke='%23c8d6e5'%3E%3Crect x='210' y='240' width='220' height='170' rx='8'/%3E%3Crect x='510' y='180' width='270' height='210' rx='8'/%3E%3Crect x='900' y='230' width='230' height='180' rx='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 720px;
  color: var(--muted);
  font-size: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-preview,
.content-panel,
.editor-panel,
.table-section,
.pricing-grid article,
.feature-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.product-preview { padding: 18px; }
.preview-bar { display: flex; gap: 7px; padding-bottom: 18px; }
.preview-bar span { width: 10px; height: 10px; border-radius: 99px; background: var(--line); }

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

.metric-tile,
.metric-card {
  padding: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-tile b,
.metric-card b {
  display: block;
  font-size: 24px;
  line-height: 1.2;
}

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

.preview-table { margin-top: 14px; border-top: 1px solid var(--line); }
.preview-table div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.preview-table b { color: var(--success); font-size: 13px; }

.split-section,
.section,
.cta-band,
.contact-section {
  padding: 72px 6vw;
}

.split-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  background: white;
}

.split-section h2,
.section-heading h2,
.cta-band h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
}

.split-section p,
.section-heading p,
.cta-band p,
.feature-grid p,
.pricing-grid p {
  color: var(--muted);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 28px;
}

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

.feature-grid article,
.pricing-grid article {
  padding: 22px;
  box-shadow: none;
}

.muted { background: #eef3f8; }
.featured { border-color: var(--accent) !important; }
.price { font-size: 26px; font-weight: 800; color: var(--ink) !important; }

.cta-band {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: center;
  background: var(--primary);
  color: white;
}
.cta-band p { color: #d7e5f6; }
.cta-band .secondary-button { background: transparent; color: white; border-color: rgba(255,255,255,0.35); }

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1fr);
  gap: 36px;
  align-items: start;
  background: var(--primary);
  color: white;
}

.contact-section p { color: #d7e5f6; }

.contact-note {
  display: grid;
  gap: 4px;
  margin-top: 22px;
  color: #d7e5f6;
}

.contact-note a {
  color: white;
  font-weight: 800;
}

.contact-form {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: white;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  color: var(--ink);
}

.contact-form label {
  color: var(--muted);
}

.screen-reader-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.response-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.response-card {
  display: grid;
  gap: 18px;
  width: min(560px, 100%);
  padding: 32px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.response-card h1 {
  margin: 0;
  font-size: 34px;
}

.response-card p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  padding: 24px 6vw;
  color: var(--muted);
  background: white;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 20px 14px;
  background: #132035;
  color: white;
}

.app-brand { margin: 0 8px 18px; }
.app-brand .brand-mark { background: var(--accent); }

.module-nav {
  display: grid;
  gap: 4px;
}

.nav-label {
  margin: 14px 12px 4px;
  color: #8fbce8;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.module-nav a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  color: #c7d4e4;
  font-size: 14px;
}

.module-nav a.active,
.module-nav a:hover {
  background: rgba(255,255,255,0.10);
  color: white;
}

.module-nav span {
  color: #8fbce8;
  text-align: center;
}

.app-main { min-width: 0; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 28px;
  background: rgba(245,247,250,0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.app-header h1 {
  margin: 0;
  font-size: 26px;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-pill {
  max-width: 280px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: white;
  border-color: var(--line);
  color: var(--accent);
}

.content-panel {
  margin: 28px;
  padding: 24px;
}

.module-toolbar,
.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.module-toolbar h2 { margin: 0; font-size: 30px; }
.module-description {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--muted);
}
.metric-grid { margin: 22px 0; }

.table-section {
  padding: 18px;
  box-shadow: none;
}

.table-heading { margin-bottom: 12px; }
.table-heading h3 { margin: 0; }

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
}

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

.data-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.7fr;
  gap: 16px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.company-table .table-row {
  grid-template-columns: 1.2fr 0.7fr 0.9fr 1fr 1fr 0.9fr;
}

.settings-table .table-row {
  grid-template-columns: 1fr 1.2fr 0.7fr 1.2fr 0.5fr;
}

.compact-table .table-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.table-row:last-child { border-bottom: 0; }
.table-head {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

.two-panel-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.settings-grid {
  align-items: start;
}

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

.settings-section {
  margin-top: 18px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.inline-check {
  width: auto;
  min-height: auto;
}

small {
  color: var(--muted);
}

.editor-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  box-shadow: none;
}

.editor-panel h3 { margin: 0; }
.editor-panel p { color: var(--muted); margin-top: 0; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }

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

.check-list span {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}

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

.row-actions a,
.row-actions button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.row-actions form {
  margin: 0;
}

.alert {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--primary);
  font-weight: 700;
}

.alert.success {
  border-color: #b7dccd;
  background: #edf8f4;
  color: var(--success);
}

.alert.error {
  border-color: #f0c4c4;
  background: #fff3f3;
  color: #9d2c2c;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(140deg, rgba(233,243,255,0.9), rgba(255,255,255,0.9)),
    var(--soft);
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(520px, 100%);
  padding: 30px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-size: 34px;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

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

@media (max-width: 980px) {
  .hero,
  .split-section,
  .contact-section,
  .app-shell,
  .form-grid,
  .two-panel-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .hero { min-height: auto; }
  .product-preview { max-width: none; }
  .feature-grid,
  .pricing-grid,
  .preview-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 720px) {
  .site-header,
  .app-header,
  .cta-band,
  .contact-section,
  .module-toolbar,
  .table-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
  }

  .feature-grid,
  .pricing-grid,
  .preview-grid,
  .metric-grid,
  .module-nav {
    grid-template-columns: 1fr;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .company-table .table-row,
  .settings-table .table-row,
  .compact-table .table-row {
    grid-template-columns: 1fr;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .content-panel { margin: 14px; padding: 16px; }
}
