:root {
  --ink: #172126;
  --muted: #62727b;
  --line: #d6e1e4;
  --line-green: rgba(8, 118, 111, 0.26);
  --paper: #ffffff;
  --page: #f7faf9;
  --green: #08766f;
  --green-dark: #055c56;
  --green-soft: #eaf7f3;
  --green-pale: #f2fbf8;
  --shadow: 0 18px 48px rgba(21, 39, 49, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  min-width: 320px;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    linear-gradient(180deg, rgba(8, 118, 111, 0.08) 0, rgba(8, 118, 111, 0) 360px),
    var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

body>main {
  flex: 1 0 auto;
}

a {
  color: var(--green-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 10;
  transform: translateY(-140%);
  border-radius: 8px;
  background: var(--green-dark);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(8, 118, 111, 0.3);
  outline-offset: 2px;
}

.shell {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid rgba(8, 118, 111, 0.22);
  background: #fff;
}

.topbar__inner {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-weight: 700;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.brand__subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.nav {
  display: flex;
  gap: 10px;
}

.nav a {
  padding: 13px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.nav a[aria-current="page"] {
  background: var(--green);
  color: #fff;
}

.hero {
  max-width: 920px;
  padding: 64px 0 34px;
}

.hero--customer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  max-width: none;
  gap: 26px;
  align-items: center;
}

.crest {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.kicker {
  margin: 0 0 12px;
  color: var(--green-dark);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  display: inline-block;
  width: 34px;
  height: 4px;
  margin-right: 10px;
  border-radius: 999px;
  background: var(--green);
  vertical-align: middle;
}

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

h1 {
  max-width: 900px;
  margin-bottom: 18px;
  font-size: 3.375rem;
  line-height: 1.04;
  letter-spacing: 0;
}

.hero p,
.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.125rem;
}

.toolbar {
  margin: 22px 0;
  border: 1px solid var(--line-green);
  border-top: 6px solid var(--green);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 28px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 180px 180px 180px auto auto;
  gap: 18px;
  align-items: end;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--green-dark);
  font-size: 0.8125rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #9abcb7;
  border-radius: 8px;
  background-color: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.field select {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--green-dark) 50%),
    linear-gradient(135deg, var(--green-dark) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 19px,
    calc(100% - 14px) 19px;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.btn--primary {
  background: var(--green);
  color: #fff;
}

.btn--primary:hover {
  background: var(--green-dark);
}

.btn--secondary {
  background: #eef3f5;
  color: var(--ink);
  border-color: var(--line);
}

.panel {
  margin-bottom: 52px;
  border: 1px solid var(--line-green);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel__head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 30px;
  border-bottom: 1px solid rgba(8, 118, 111, 0.22);
  background: var(--green-soft);
}

.panel__head h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 1.5rem;
}

.result-count {
  color: var(--muted);
}

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

.contracts-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.contracts-table__date {
  width: 10%;
}

.contracts-table__validity {
  width: 11%;
}

.contracts-table__name {
  width: 32%;
}

.contracts-table__owner {
  width: 20%;
}

.contracts-table__partner {
  width: 18%;
}

.contracts-table__type {
  width: 9%;
}

.contracts-table th {
  background: var(--green-dark);
  color: #fff;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  padding: 18px 30px;
  text-align: left;
  text-transform: uppercase;
}

.contracts-table td {
  border-top: 1px solid rgba(8, 118, 111, 0.16);
  padding: 21px 30px;
  font-size: 1.0625rem;
  vertical-align: top;
}

.contracts-table tbody tr:hover {
  background: var(--green-pale);
}

.contract-link {
  color: var(--green-dark);
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e6f4ef;
  color: var(--green-dark);
  font-size: 0.8125rem;
  font-weight: 700;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 30px;
  border-top: 1px solid rgba(8, 118, 111, 0.18);
  background: #fbfefd;
}

.pager__buttons {
  display: flex;
  gap: 8px;
}

.pager__buttons a,
.pager__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.pager__buttons a[aria-current="page"] {
  background: var(--green);
  color: #fff;
}

.pager__button.is-disabled {
  color: #9aabb2;
  cursor: not-allowed;
  opacity: 0.65;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

.empty-mobile {
  display: none;
  margin: 0;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.mobile-cards {
  display: none;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 52px;
}

.section {
  border: 1px solid var(--line-green);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 24px;
}

.section h2 {
  margin-bottom: 18px;
  color: var(--green-dark);
  font-size: 1.5rem;
}

.definition-list {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px 22px;
  margin: 0;
}

.definition-list dt {
  color: var(--muted);
  font-weight: 700;
}

.definition-list dd {
  margin: 0;
}

.stack-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 16px;
}

.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

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

.footer {
  margin-top: auto;
  border-top: 1px solid rgba(8, 118, 111, 0.22);
  background: #fff;
  color: var(--muted);
  padding: 28px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer__product {
  max-width: 800px;
  text-align: right;
}

.footer__product a {
  font-weight: 700;
}

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

@media (max-width: 1100px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1320px);
  }

  .topbar__inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    padding: 34px 0 24px;
  }

  .hero--customer {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.15rem;
  }

  .filter-grid,
  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .section {
    padding: 20px;
  }

  .panel__head,
  .pager,
  .footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer__product {
    text-align: left;
  }

  .table-wrap {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 12px;
    padding: 16px;
  }

  .empty-mobile {
    display: block;
  }

  .contract-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 16px;
  }

  .contract-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.875rem;
  }

  .definition-list,
  .document-row {
    grid-template-columns: 1fr;
  }
}