:root {
  --wine: #6e0f16;
  --wine-deep: #3b080c;
  --gold: #d7b46a;
  --gold-soft: #f0d99a;
  --ink: #1e1b18;
  --muted: #667085;
  --line: #e7e0d5;
  --surface: #ffffff;
  --mist: #f5f6f8;
  --ivory: #fbf7ef;
  --green: #2f855a;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #b42318;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--mist);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  background: var(--wine-deep);
  color: #fff4da;
  font-size: 13px;
}

.topbar__inner,
.header__inner,
.footer__inner {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 247, 239, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header__inner {
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(215, 180, 106, 0.5);
}

.brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand--dark {
  color: white;
}

.brand--dark small {
  color: var(--gold-soft);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 750;
}

.nav-links a {
  text-decoration: none;
}

.nav-portal {
  color: var(--wine);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 10px 12px;
}

.nav-portal--dark {
  background: var(--wine);
  color: white;
  border-color: var(--wine);
}

.menu-button {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
  font-weight: 800;
}

.hero {
  background:
    linear-gradient(120deg, rgba(59, 8, 12, 0.94), rgba(110, 15, 22, 0.9)),
    url("logo-aekita.png") center right 9% / 480px no-repeat;
  color: white;
}

.hero__grid {
  min-height: 700px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 48px;
  align-items: center;
}

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

.eyebrow--gold,
.hero .eyebrow {
  color: var(--gold-soft);
}

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

h1 {
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.96;
  max-width: 850px;
}

h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
}

h3 {
  font-size: 20px;
}

.hero__copy > p:not(.eyebrow),
.lead {
  color: #f5ead5;
  font-size: 18px;
  line-height: 1.7;
  margin-top: 18px;
}

.lead {
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: var(--wine-deep);
  padding: 0 18px;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
}

.button--ghost {
  background: white;
  color: var(--wine);
}

.button--ghost-light {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.button--small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 34px 0 0;
}

.metrics div,
.hero__panel,
.service-card,
.finance-grid article,
.people-grid article,
.contact-form,
.login-panel,
.client-preview,
.app-panel,
.dashboard-kpis article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metrics div {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  padding: 16px;
}

.metrics dt {
  color: var(--gold-soft);
  font-size: 25px;
  font-weight: 900;
}

.metrics dd {
  margin: 8px 0 0;
  color: #f5ead5;
  font-size: 13px;
  line-height: 1.4;
}

.hero__panel {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.panel-line,
.system-board div,
.bank-lines p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.panel-line:last-child,
.bank-lines p:last-child {
  border-bottom: 0;
}

.panel-line span,
.system-board span,
.bank-lines span {
  color: var(--muted);
}

.section {
  padding: 90px 0;
  background: var(--mist);
}

.section--ivory {
  background: var(--ivory);
}

.section--wine {
  background: var(--wine-deep);
  color: white;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.section-heading > p:not(.eyebrow) {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.service-grid,
.finance-grid,
.people-grid,
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.service-card,
.finance-grid article,
.people-grid article {
  padding: 22px;
}

.service-card span,
.people-grid span {
  color: var(--wine);
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
}

.service-card h3,
.finance-grid h3,
.people-grid h3 {
  margin-top: 12px;
}

.service-card p,
.finance-grid p,
.people-grid p {
  color: var(--muted);
  line-height: 1.6;
  margin-top: 10px;
}

.split-layout,
.system-grid,
.contact-grid,
.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 44px;
  align-items: start;
}

.system-grid--single {
  grid-template-columns: minmax(0, 760px);
}

.steps {
  display: grid;
  gap: 14px;
}

.step {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.step > strong {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--wine);
  color: white;
}

.step p {
  color: var(--muted);
  line-height: 1.6;
  margin-top: 6px;
}

.system-grid p {
  color: #f7ead3;
  line-height: 1.7;
  margin-top: 16px;
}

.system-board {
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 22px;
}

.system-board--public strong {
  text-align: right;
}

.system-board strong {
  font-variant-numeric: tabular-nums;
}

.contact-form,
.login-form {
  display: grid;
  gap: 14px;
}

.contact-form {
  padding: 22px;
}

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

input,
select,
textarea,
.app-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 12px 13px;
  font: inherit;
}

address {
  color: var(--muted);
  font-style: normal;
  line-height: 1.8;
  margin-top: 22px;
}

.footer {
  background: var(--wine-deep);
  color: #f7ead3;
  font-size: 13px;
}

.footer--light {
  border-top: 1px solid var(--line);
}

.footer--app {
  grid-column: 2;
  padding: 0 26px;
}

.footer__inner {
  line-height: 1.5;
}

.portal-page {
  background: linear-gradient(145deg, var(--ivory), var(--mist));
}

.portal-layout {
  min-height: calc(100vh - 78px);
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0;
}

.login-panel,
.client-preview {
  padding: 26px;
}

.access-rules {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 26px;
}

.access-rules h2 {
  color: var(--wine-deep);
}

.rule-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.rule-list p {
  color: var(--muted);
  line-height: 1.6;
}

.login-panel h1 {
  color: var(--wine-deep);
  font-size: clamp(36px, 5vw, 60px);
}

.login-panel p {
  color: var(--muted);
  line-height: 1.7;
  margin: 16px 0 24px;
}

.client-preview {
  display: none;
  grid-column: 1 / -1;
}

.client-preview.is-visible {
  display: block;
}

.client-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.client-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.client-kpis div,
.case-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffdf9;
}

.client-kpis span,
.case-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-kpis strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.case-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.case-card p,
.timeline p {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
}

.timeline {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.system-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--mist);
}

.app-sidebar {
  background: linear-gradient(180deg, var(--wine-deep), var(--wine));
  color: white;
  padding: 22px;
}

.app-nav {
  display: grid;
  gap: 6px;
  margin-top: 26px;
}

.erp-page .app-nav {
  display: none;
}

.erp-page.is-unlocked .app-nav {
  display: grid;
}

.app-nav a {
  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
  border-radius: 8px;
  padding: 11px 12px;
  font-weight: 750;
}

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

.app-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  min-height: 76px;
  padding: 16px 26px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(12px);
}

.app-search {
  max-width: 560px;
  color: var(--muted);
}

.app-status {
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
}

.dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 999px;
  background: var(--green);
}

.dashboard {
  padding: 26px;
  display: grid;
  gap: 18px;
}

.erp-gate {
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.erp-dashboard {
  display: none;
}

.erp-dashboard.is-visible {
  display: grid;
}

.erp-page.is-unlocked .erp-gate {
  display: none;
}

.dashboard-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.dashboard h1 {
  color: var(--ink);
  font-size: clamp(34px, 5vw, 54px);
}

.dashboard-kpis {
  grid-template-columns: repeat(4, 1fr);
}

.dashboard-kpis article {
  padding: 18px;
}

.dashboard-kpis span,
.fund-grid span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
}

.dashboard-kpis strong {
  display: block;
  font-size: 25px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.dashboard-kpis small,
.fund-grid small {
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.dashboard-grid--bottom {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
}

.app-panel {
  overflow: hidden;
}

.app-panel header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.app-panel h2 {
  font-size: 19px;
}

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

.fund-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  padding: 14px;
}

.fund-grid strong {
  display: block;
  font-size: 22px;
  margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}

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

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

th,
td {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

th {
  color: var(--muted);
  background: #fcfbf8;
  font-size: 11px;
  text-transform: uppercase;
}

.status-pill,
.status-ok,
.status-warn,
.status-risk,
.status-info {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill {
  background: var(--ivory);
  color: var(--wine);
  border: 1px solid var(--line);
}

.status-ok {
  background: #e8f5ee;
  color: var(--green);
}

.status-warn {
  background: #fff5dd;
  color: var(--amber);
}

.status-risk {
  background: #fdecec;
  color: var(--red);
}

.status-info {
  background: #eaf1ff;
  color: var(--blue);
}

.activity-list,
.bank-lines {
  padding: 18px;
}

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

.activity-list p {
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 1020px) {
  .hero__grid,
  .split-layout,
  .system-grid,
  .contact-grid,
  .portal-layout,
  .erp-gate,
  .dashboard-grid,
  .dashboard-grid--bottom {
    grid-template-columns: 1fr;
  }

  .service-grid,
  .finance-grid,
  .people-grid,
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-page {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
  }

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

@media (max-width: 760px) {
  .topbar__inner,
  .footer__inner,
  .header__inner,
  .dashboard-title,
  .app-top,
  .client-header,
  .case-card {
    align-items: stretch;
    flex-direction: column;
  }

  .menu-button {
    display: inline-flex;
    align-self: flex-end;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0 0 16px;
  }

  .nav-links.is-open,
  .nav-links--static {
    display: flex;
  }

  .header__inner {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .hero__grid {
    min-height: auto;
    padding: 70px 0;
  }

  .metrics,
  .service-grid,
  .finance-grid,
  .people-grid,
  .client-kpis,
  .dashboard-kpis,
  .fund-grid,
  .app-nav {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 64px 0;
  }
}
