:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-soft: #eef7f2;
  --text: #172033;
  --muted: #657287;
  --line: #dde5ef;
  --blue: #245bdb;
  --blue-dark: #123a9b;
  --green: #0e9f6e;
  --coral: #e6675b;
  --amber: #d99a16;
  --violet: #6554c0;
  --shadow: 0 14px 40px rgba(32, 48, 74, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
}

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

button,
input {
  font: inherit;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.topline {
  background: #172033;
  color: #dce7f5;
  font-size: 13px;
}

.topline__inner,
.header-main,
.product-nav,
.footer__inner {
  display: flex;
  align-items: center;
}

.topline__inner {
  min-height: 34px;
  justify-content: space-between;
  gap: 16px;
}

.topline nav {
  display: flex;
  gap: 18px;
  color: #ffffff;
}

.header-main {
  min-height: 78px;
  gap: 20px;
}

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

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  letter-spacing: 0;
}

.brand__text {
  font-size: 22px;
}

.search {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 48px 0 16px;
  background: #f8fafc;
}

.search button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
}

.login-button,
.primary-action,
.secondary-action,
.close-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.login-button,
.primary-action {
  background: var(--blue);
  color: #ffffff;
}

.login-button {
  min-height: 44px;
  padding: 0 22px;
}

.product-nav {
  min-height: 46px;
  gap: 22px;
  overflow-x: auto;
  color: #334155;
  font-size: 15px;
}

.product-nav a {
  white-space: nowrap;
}

.hero {
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  border-bottom: 1px solid var(--line);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: 36px;
  min-height: 490px;
  padding: 44px 0;
}

.eyebrow,
.muted-label {
  display: block;
  margin: 0 0 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.calculator h2,
.promo-band h2,
.section-heading h2,
.cabinet h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.08;
}

.hero h1 {
  max-width: 680px;
  font-size: clamp(34px, 5vw, 62px);
}

.hero__lead {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
}

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

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.hero__visual {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #e8eef8;
}

.hero__visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.quick-services,
.calculator-section,
.content-grid,
.cabinet {
  padding: 42px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2,
.calculator h2,
.promo-band h2,
.cabinet h2 {
  font-size: 28px;
}

.section-heading a,
.footer a {
  color: var(--blue);
  font-weight: 700;
}

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

.service-card,
.news,
.calculator,
.file-browser {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(32, 48, 74, 0.06);
}

.service-card {
  padding: 22px;
}

.service-card__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  margin-bottom: 18px;
  color: #ffffff;
  font-weight: 900;
}

.service-card h3,
.news h3 {
  margin: 0;
  line-height: 1.25;
}

.service-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.service-card--green .service-card__icon {
  background: var(--green);
}

.service-card--blue .service-card__icon {
  background: var(--blue);
}

.service-card--coral .service-card__icon {
  background: var(--coral);
}

.service-card--amber .service-card__icon {
  background: var(--amber);
}

.market-strip {
  padding: 18px 0;
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.market-strip__inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.market-strip__inner > div {
  border-left: 3px solid var(--line);
  padding-left: 14px;
}

.market-strip strong {
  display: block;
  font-size: 22px;
}

.trend {
  color: var(--muted);
  font-size: 13px;
}

.trend--up {
  color: var(--green);
}

.trend--down {
  color: var(--coral);
}

.calculator {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  padding: 28px;
}

.calculator__copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.calc-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.calc-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.calc-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
}

.calc-result {
  grid-column: 1 / -1;
  padding: 16px;
  border-radius: 8px;
  background: #edfdf5;
  color: #087251;
  font-size: 20px;
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 20px;
  padding-top: 0;
}

.promo-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 260px;
  padding: 34px;
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(23, 32, 51, 0.92), rgba(36, 91, 219, 0.82)),
    url("assets/finance-dashboard.png") center / cover;
  color: #ffffff;
}

.promo-band .eyebrow {
  color: #a8f2d5;
}

.promo-band h2 {
  max-width: 620px;
}

.news {
  padding: 22px;
}

.section-heading--compact {
  align-items: center;
}

.news article {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.news time {
  color: var(--muted);
  font-size: 13px;
}

.news h3 {
  margin-top: 5px;
  font-size: 16px;
}

.cabinet {
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.cabinet[hidden] {
  display: none;
}

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

.close-button {
  width: 42px;
  height: 42px;
  background: #f2f5f9;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.file-browser {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  overflow: hidden;
}

.folder-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  background: #f7fafc;
  border-right: 1px solid var(--line);
}

.folder {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-weight: 700;
}

.folder span {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 16px;
  border-radius: 3px;
  background: var(--amber);
}

.folder span::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -5px;
  width: 10px;
  height: 6px;
  border-radius: 3px 3px 0 0;
  background: #f0b33c;
}

.folder.is-active {
  border-color: #bed1ff;
  background: #eef4ff;
  color: var(--blue-dark);
}

.file-panel {
  min-height: 320px;
  padding: 22px;
}

.file-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.file-panel__top h3 {
  margin: 0;
  font-size: 22px;
}

.file-panel__top span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.file-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.file-item__badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  border-radius: 6px;
  background: #eaf0ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.file-item strong,
.file-item small {
  display: block;
  min-width: 0;
}

.file-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item small {
  color: var(--muted);
}

.file-item button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.file-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--blue);
  font-weight: 800;
}

.folder-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #bed1ff;
  border-radius: 8px;
  background: #eef4ff;
  color: var(--blue-dark);
  font-weight: 800;
}

.folder-download.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.admin-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 18px;
  color: var(--blue);
  font-weight: 800;
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.admin-page {
  padding: 36px 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 0.7fr);
  gap: 18px;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(32, 48, 74, 0.06);
}

.admin-panel h1 {
  margin: 0 0 18px;
  font-size: 32px;
  line-height: 1.1;
}

.admin-panel--wide {
  grid-column: 1 / -1;
}

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

.admin-form--inline {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.admin-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.admin-form input,
.admin-form select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #ffffff;
}

.admin-form input[type="file"] {
  padding: 10px 12px;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.folder-pick-summary {
  margin: -4px 0 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.folder-picker {
  position: relative;
}

.folder-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.folder-picker__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 100%;
  border: 1px solid #bed1ff;
  border-radius: 8px;
  background: #eef4ff;
  color: var(--blue-dark);
  cursor: pointer;
  font-weight: 800;
}

.admin-files {
  display: grid;
  gap: 12px;
}

.admin-folder-manager {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-folder-manager h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.admin-folder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-folder-row strong,
.admin-folder-row small {
  display: block;
}

.admin-folder-row small {
  color: var(--muted);
}

.admin-folder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-folder-actions a,
.admin-folder-row button {
  min-height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.admin-folder-actions a {
  border: 1px solid #bed1ff;
  background: #eef4ff;
  color: var(--blue-dark);
}

.admin-folder-row button {
  border: 1px solid #f0b4b0;
  background: #fff4f3;
  color: #b42318;
}

.admin-folder {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.admin-folder summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
}

.admin-folder summary::-webkit-details-marker {
  display: none;
}

.admin-folder__chevron {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #eef4ff;
  color: var(--blue-dark);
  font-size: 24px;
  line-height: 1;
  transition: transform 160ms ease;
}

.admin-folder[open] .admin-folder__chevron {
  transform: rotate(90deg);
}

.admin-folder__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 900;
}

.admin-folder__count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-folder .file-list {
  padding: 0 16px 16px;
}

.footer {
  background: #172033;
  color: #dce7f5;
}

.footer__inner {
  min-height: 76px;
  justify-content: space-between;
  gap: 16px;
}

.footer p {
  margin: 0;
}

.footer a {
  color: #ffffff;
}

@media (max-width: 900px) {
  .header-main,
  .topline__inner {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 0;
  }

  .topline nav {
    flex-wrap: wrap;
  }

  .hero__grid,
  .calculator,
  .content-grid,
  .file-browser {
    grid-template-columns: 1fr;
  }

  .hero__grid {
    min-height: auto;
  }

  .service-grid,
  .market-strip__inner,
  .file-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .folder-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .brand__text {
    font-size: 19px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero__lead {
    font-size: 16px;
  }

  .service-grid,
  .market-strip__inner,
  .calc-form,
  .file-list {
    grid-template-columns: 1fr;
  }

  .promo-band,
  .footer__inner,
  .file-panel__top {
    align-items: stretch;
    flex-direction: column;
  }

  .promo-band {
    min-height: 300px;
    padding: 24px;
  }

  .file-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .file-item button,
  .file-open {
    grid-column: 1 / -1;
  }

  .admin-layout,
  .admin-form--inline,
  .admin-folder-row,
  .admin-folder-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
}
