:root {
  --bg: #f2efe6;
  --surface: #fffdf8;
  --surface-2: #f7f3ea;
  --ink: #162118;
  --soft: #566157;
  --muted: #7b837b;
  --line: #e4dccd;
  --green: #1b6b43;
  --green-dark: #0c2d1d;
  --green-soft: #e6f3ea;
  --gold: #e3a439;
  --red: #b94d43;
  --red-soft: #fbeae7;
  --shadow: 0 18px 45px rgba(20, 36, 25, .07);
  --sans: "Manrope", "Avenir Next", sans-serif;
  --serif: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); }
button, input, select { color: inherit; font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, p { margin: 0; }
h1 { font: 560 clamp(32px, 4vw, 48px)/1 var(--serif); letter-spacing: -.035em; }
h2 { font-size: 18px; line-height: 1.25; }
svg { display: block; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 76px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 253, 248, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand__icon { width: 44px; height: 44px; border-radius: 13px; background: url("../images/kolos-soz.by_logo.avif") center/cover no-repeat; }
.brand strong { display: block; color: var(--green-dark); font: 560 27px/.86 var(--serif); letter-spacing: -.03em; }
.brand small { display: flex; align-items: center; gap: 5px; margin-top: 7px; color: var(--green-dark); font-size: 8px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.app-header__right { display: flex; align-items: center; gap: 10px; }
.icon-btn, .profile-button, .menu-button {
  border: 1px solid var(--line);
  background: var(--surface);
}
.icon-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }
.profile-button { height: 48px; padding: 4px 10px 4px 5px; display: flex; align-items: center; gap: 9px; border-radius: 999px; text-align: left; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--green-dark); color: white; font-weight: 800; }
.profile-button small, .profile-button b { display: block; }
.profile-button small { color: var(--muted); font-size: 10px; }
.profile-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.menu-button { display: none; width: 44px; height: 44px; border-radius: 13px; padding: 0; }
.menu-button span { display: block; width: 18px; height: 1.5px; margin: 4px auto; background: currentColor; transition: transform .25s ease, opacity .2s ease; }
.menu-button[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-button[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-button[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.app-layout { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  padding: 24px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar__title { display: inline-block; margin: 0 8px 20px; padding: 9px 13px; border: 1px solid var(--green); border-radius: 999px; color: var(--green); font-weight: 750; }
.sidebar__nav { display: grid; gap: 5px; }
.nav-item {
  width: 100%;
  min-height: 45px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--soft);
  text-align: left;
  font-weight: 700;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.is-active { background: var(--green); color: white; }
.nav-icon { width: 23px; font-size: 20px; line-height: 1; text-align: center; }
.nav-badge { margin-left: auto; min-width: 21px; height: 21px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--red); color: white; font-size: 10px; }
.logout { display: inline-flex; margin: 24px 8px 0; padding: 9px 18px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 700; }

.workspace { min-width: 0; padding: 36px clamp(20px, 4vw, 58px) 70px; }
.page { display: none; width: min(1160px, 100%); margin: 0 auto; }
.page.is-active { display: block; animation: page-in .28s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head p:not(.eyebrow) { margin-top: 10px; color: var(--soft); font-size: 15px; }
.eyebrow { margin-bottom: 7px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.button { min-height: 44px; padding: 11px 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid transparent; font-weight: 800; }
.button--primary { background: var(--green); color: white; }
.button--primary:hover { background: var(--green-dark); }
.button--ghost { background: transparent; border-color: var(--line); }
.button--block { width: 100%; }
.text-button { border: 0; background: none; color: var(--green); font-weight: 800; }

.status-card {
  margin-bottom: 18px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  border-radius: 22px;
  background: var(--green-dark);
  color: white;
}
.status-card__label { display: block; margin-bottom: 6px; color: #bdcbbf; font-size: 12px; }
.status-card strong { font: 560 24px/1.2 var(--serif); }
.status-list { margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; list-style: none; font-size: 12px; }
.status-list span { color: var(--gold); font-weight: 800; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-grid--three { grid-template-columns: repeat(3, 1fr); }
.metric { min-height: 145px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.metric--dark { background: var(--green); border-color: transparent; color: white; }
.metric span { color: var(--muted); font-size: 12px; }
.metric--dark span, .metric--dark small { color: #d8e8de; }
.metric strong { font: 560 clamp(22px, 2.4vw, 31px)/1 var(--serif); letter-spacing: -.02em; }
.metric small { color: var(--muted); }
.metric .positive { color: var(--green); font-weight: 800; }

.dashboard-grid, .two-columns, .card-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-bottom: 18px; }
.two-columns { grid-template-columns: 1fr .8fr; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.panel-head { min-height: 45px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-head span { color: var(--muted); font-size: 12px; }
.panel-head h2 { margin-top: 3px; }
.chip { padding: 7px 10px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.chart { height: 210px; padding: 25px 5px 0; }
.chart__bars { height: 100%; display: flex; align-items: flex-end; gap: clamp(8px, 2vw, 22px); border-bottom: 1px solid var(--line); }
.chart__bars i { position: relative; height: var(--h); flex: 1; border-radius: 10px 10px 0 0; background: linear-gradient(180deg, var(--green), #77aa89); }
.chart__bars i:last-child { background: linear-gradient(180deg, var(--gold), #f0c876); }
.chart__bars span { position: absolute; top: calc(100% + 7px); left: 50%; color: var(--muted); font: 10px var(--sans); transform: translateX(-50%); }
.donut-row { min-height: 210px; display: flex; align-items: center; justify-content: space-around; gap: 22px; }
.donut { width: 142px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) 0 47.8%, var(--gold) 47.8% 97.2%, var(--red) 97.2%); }
.donut::before { content: ""; grid-area: 1/1; width: 88px; aspect-ratio: 1; border-radius: 50%; background: var(--surface); }
.donut span { z-index: 1; grid-area: 1/1; font: 560 30px var(--serif); text-align: center; }
.donut small { display: block; color: var(--muted); font: 10px var(--sans); }
.legend { min-width: 145px; margin: 0; padding: 0; display: grid; gap: 13px; list-style: none; }
.legend li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.legend__dot { width: 9px; height: 9px; border-radius: 50%; }
.legend__dot--green { background: var(--green); }.legend__dot--gold { background: var(--gold); }.legend__dot--red { background: var(--red); }

.compact-list { margin-top: 8px; }
.compact-list > div { padding: 13px 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.compact-list > div:last-child { border-bottom: 0; }
.compact-list small { display: block; color: var(--muted); margin-top: 2px; }
.compact-list > div > strong { color: var(--green); }
.round-icon, .large-icon { display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 800; }
.round-icon { width: 36px; height: 36px; }
.large-icon { width: 54px; height: 54px; font-size: 22px; }

.settings-form { display: grid; gap: 16px; }
.settings-form > h2 { margin-bottom: 4px; }
.settings-form label > span, .modal label > span, .filters-panel label > span { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 800; }
input, select { width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(27,107,67,.1); }
.input-with-unit, .range-fields { display: flex; align-items: center; gap: 8px; }
.input-with-unit b { min-width: 48px; color: var(--muted); }
.range-fields input { min-width: 0; }
.range-fields em { font-style: normal; }
.range-fields b { color: var(--muted); white-space: nowrap; }
.hint-panel .large-icon { margin-bottom: 18px; }
.hint-panel p { margin-top: 10px; color: var(--soft); }
.check-list { margin: 20px 0 0; padding: 0; display: grid; gap: 11px; list-style: none; }
.check-list li::before { content: "✓"; margin-right: 8px; color: var(--green); font-weight: 900; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 58px; height: 32px; display: block; border-radius: 999px; background: #c9cec9; padding: 4px; transition: background .2s; }
.switch span::after { content: ""; width: 24px; height: 24px; display: block; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.14); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(26px); }

.filters-panel { margin-bottom: 16px; padding: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.offer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.offer-card { padding: 20px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); box-shadow: var(--shadow); }
.offer-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.offer-card__top span { display: block; color: var(--muted); font-size: 11px; }
.offer-card__top strong { display: block; margin-top: 4px; font: 560 27px var(--serif); }
.rating { padding: 7px 10px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 10px; text-align: right; }
.rating b { color: var(--ink); }
.offer-card dl, .payment dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.offer-card dl { margin: 18px 0; }
.offer-card dl div, .payment dl div { padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
dt { color: var(--muted); font-size: 10px; } dd { margin: 2px 0 0; font-weight: 800; }
.borrower { margin-bottom: 16px; padding: 11px; display: flex; align-items: center; gap: 9px; border-radius: 13px; background: var(--surface-2); }
.borrower small, .borrower b { display: block; }
.borrower small { color: var(--muted); font-size: 10px; }

.toolbar { margin-bottom: 15px; display: grid; grid-template-columns: 1fr 220px; gap: 12px; }
.search { position: relative; display: block; }
.search span { position: absolute; left: 14px; top: 50%; color: var(--muted); font-size: 19px; transform: translateY(-50%); }
.search input { padding-left: 42px; }
.search--full { margin-bottom: 14px; }
.investment-list, .payment-list, .notification-list { display: grid; gap: 10px; }
.investment { padding: 16px; display: grid; grid-template-columns: 1fr 1.5fr 1fr 1fr auto; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.investment small { display: block; color: var(--muted); font-size: 10px; }
.investment a { color: var(--green); font-weight: 800; text-decoration: none; }
.status { padding: 7px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status--active, .status--closed { background: var(--green-soft); color: var(--green); }
.status--late { background: var(--red-soft); color: var(--red); }
.empty-state { padding: 60px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 20px; }
.empty-state p { margin-top: 7px; color: var(--muted); }

.payment { padding: 18px; display: grid; grid-template-columns: 180px 1fr; gap: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.payment__amount { display: flex; flex-direction: column; padding-right: 18px; border-right: 1px solid var(--line); }
.payment__amount small, .payment__amount span { color: var(--muted); }
.payment__amount strong { margin: 4px 0 auto; font: 560 28px var(--serif); }
.payment dl { margin: 0; grid-template-columns: repeat(4, 1fr); }

.timeline { margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); }
.timeline > div { position: relative; display: flex; gap: 10px; }
.timeline > div:not(:last-child)::after { content: ""; position: absolute; left: 38px; right: 8px; top: 15px; height: 1px; background: var(--line); }
.timeline i { position: relative; z-index: 1; width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-style: normal; }
.timeline .is-done i, .timeline .is-current i { border-color: var(--green); background: var(--green); color: white; }
.timeline b, .timeline small { display: block; }
.timeline small { margin-top: 4px; color: var(--muted); font-size: 10px; }

.line-chart { height: 235px; margin-top: 14px; }
.line-chart svg { width: 100%; height: 100%; overflow: visible; }
.line-chart .area { fill: url(#area); }
.line-chart .line { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; }
.bar-list { margin-top: 25px; display: grid; gap: 22px; }
.bar-list span { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--soft); }
.bar-list i { height: 10px; display: block; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-list em { height: 100%; display: block; border-radius: inherit; background: var(--green); }
.bar-list em.red { background: var(--red); }

.notice { position: relative; padding: 18px; display: flex; gap: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.notice.is-unread::after { content: ""; position: absolute; right: 16px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.notice h2 { padding-right: 20px; font-size: 15px; }
.notice p { margin: 5px 0; color: var(--soft); }
.notice small { color: var(--muted); }

.card-grid { grid-template-columns: 1fr 1fr; }
.bank-card { min-height: 260px; padding: 25px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 25px; background: linear-gradient(135deg, #205f40, #0c2d1d); color: white; box-shadow: var(--shadow); }
.bank-card__label { color: #c7d9cc; }
.card-chip { width: 45px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, #f5ce6f, var(--gold)); }
.bank-card > strong { font: 560 clamp(25px, 3vw, 35px) var(--serif); letter-spacing: .04em; }
.bank-card > div:last-child { display: flex; justify-content: space-between; color: #d6e2d9; font-size: 11px; letter-spacing: .08em; }
.method-info p { margin-top: 9px; color: var(--soft); }

.identity { margin-bottom: 15px; display: flex; gap: 14px; align-items: center; }
.identity p { margin-top: 5px; color: var(--muted); }
.security button { width: 100%; padding: 14px 0; display: flex; justify-content: space-between; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-weight: 700; }
.security button:last-child { border: 0; }
.security button span { color: var(--muted); font-weight: 600; }

.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; }
.modal.is-open { display: grid; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(8, 21, 13, .6); backdrop-filter: blur(4px); }
.modal__card { position: relative; z-index: 1; width: min(450px, 100%); padding: 26px; border-radius: 24px; background: var(--surface); box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.modal__close { position: absolute; right: 14px; top: 14px; width: 35px; height: 35px; border: 0; border-radius: 50%; background: var(--surface-2); font-size: 22px; }
.modal__card .large-icon { margin-bottom: 16px; }
.modal__card p { margin: 10px 0 18px; color: var(--soft); }
.modal__card label { display: block; margin-bottom: 14px; }
.toast { position: fixed; z-index: 120; right: 24px; bottom: 24px; padding: 13px 18px; border-radius: 13px; background: var(--green-dark); color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .25s ease; }
.toast.is-on { opacity: 1; transform: none; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .offer-grid { grid-template-columns: 1fr 1fr; }
  .investment { grid-template-columns: 1fr 1.4fr 1fr auto; }
  .investment > div:nth-child(4) { display: none; }
  .payment dl { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .app-header { padding: 0 16px; }
  .profile-button__text { display: none; }
  .profile-button { width: 46px; padding: 4px; }
  .profile-button svg { display: none; }
  .menu-button { display: block; }
  .app-layout { display: block; }
  .sidebar { position: fixed; z-index: 45; top: 76px; left: 0; right: 0; height: calc(100vh - 76px); padding: 20px 16px 45px; border: 0; transform: translateX(105%); transition: transform .35s cubic-bezier(.22,1,.36,1); }
  .sidebar.is-open { transform: none; }
  .sidebar__nav { gap: 7px; }
  .nav-item { min-height: 48px; border: 1px solid var(--line); }
  .workspace { padding: 28px 16px 60px; }
  .dashboard-grid, .two-columns, .card-grid { grid-template-columns: 1fr; }
  .offer-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; gap: 18px; }
  .timeline > div:not(:last-child)::after { left: 15px; right: auto; top: 30px; bottom: -18px; width: 1px; height: auto; }
}

@media (max-width: 600px) {
  .brand strong { font-size: 24px; }
  .brand small { font-size: 7px; letter-spacing: .12em; }
  .brand__icon { width: 40px; height: 40px; }
  .notification-button { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .page-head > .button, .page-head > select { width: 100%; }
  .status-card { flex-direction: column; }
  .status-list { display: grid; grid-template-columns: 1fr; }
  .metric-grid, .metric-grid--three { grid-template-columns: 1fr; }
  .metric { min-height: 125px; }
  .donut-row { flex-direction: column; }
  .compact-list > div { grid-template-columns: auto 1fr; }
  .compact-list > div > strong { grid-column: 2; }
  .filters-panel { display: none; grid-template-columns: 1fr; }
  .filters-panel.is-open { display: grid; }
  .toolbar { grid-template-columns: 1fr; }
  .investment { grid-template-columns: 1fr auto; }
  .investment > div { display: none; }
  .investment > div:nth-child(1), .investment > div:nth-child(2) { display: block; }
  .investment .status { grid-column: 2; grid-row: 1 / span 2; }
  .payment { grid-template-columns: 1fr; }
  .payment__amount { padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--line); }
  .payment__amount strong { margin: 4px 0; }
  .payment dl { grid-template-columns: 1fr 1fr; }
  .panel { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
