:root {
  --ink: #171717;
  --muted: #6c6b66;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --line: #e3dfd4;
  --line-strong: #cfc7b8;
  --gold: #b99143;
  --gold-soft: #efe3c7;
  --green: #0c6f5c;
  --green-soft: #dbeee8;
  --red: #b84b40;
  --red-soft: #f4dfdc;
  --black: #10100f;
  --shadow: 0 18px 48px rgba(31, 29, 24, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(120deg, rgba(185, 145, 67, 0.09), transparent 32%),
    linear-gradient(180deg, #fbfaf7 0%, #f2f0ea 100%);
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.app-shell {
  min-height: 100vh;
}

.loader {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: var(--radius);
  background: var(--black);
  color: var(--gold-soft);
  font-weight: 800;
}

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

.auth-visual {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  background:
    linear-gradient(145deg, rgba(16, 16, 15, 0.92), rgba(21, 20, 17, 0.96)),
    radial-gradient(circle at 70% 20%, rgba(185, 145, 67, 0.28), transparent 28%);
  color: #f8f3e9;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-row .mark {
  margin: 0;
  background: #f8f3e9;
  color: var(--black);
}

.auth-title {
  max-width: 680px;
}

.auth-title h1 {
  max-width: 650px;
  margin: 0 0 20px;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 0.96;
  letter-spacing: 0;
}

.auth-title p {
  max-width: 560px;
  margin: 0;
  color: rgba(248, 243, 233, 0.78);
  font-size: 18px;
  line-height: 1.6;
}

.auth-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.auth-metric {
  border-top: 1px solid rgba(248, 243, 233, 0.18);
  padding-top: 14px;
}

.auth-metric strong {
  display: block;
  color: #fff;
  font-size: 26px;
}

.auth-metric span {
  color: rgba(248, 243, 233, 0.66);
}

.auth-panel {
  width: min(100%, 440px);
  min-height: auto;
  display: flex;
  align-items: center;
  padding: 0;
  background: transparent;
}

.auth-card {
  width: 100%;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-weight: 900;
}

.auth-card-brand .mark {
  margin: 0;
}

.auth-card-brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.lock-page {
  background:
    linear-gradient(145deg, rgba(16, 16, 15, 0.96), rgba(38, 35, 28, 0.94)),
    linear-gradient(180deg, #fbfaf7 0%, #f2f0ea 100%);
}

.lock-card {
  border-color: rgba(239, 227, 199, 0.24);
}

.pin-entry {
  display: grid;
  gap: 14px;
}

.pin-dots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.pin-dots span {
  min-height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.pin-dots span.filled {
  border-color: rgba(185, 145, 67, 0.58);
  background: #fffaf0;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pin-key {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.pin-key:active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.pin-key-empty {
  border: 0;
  background: transparent;
}

.lock-logout {
  width: 100%;
  margin-top: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.auth-card h2,
.section-title h2 {
  margin-bottom: 10px;
  font-size: 28px;
}

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

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

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field span,
.inline-label,
.check-line {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.field input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  line-height: 1.25;
}

.field input[type="date"]::-webkit-date-and-time-value {
  min-height: 22px;
  text-align: left;
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  margin: 0;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field-wide {
  grid-column: 1 / -1;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 145, 67, 0.16);
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-button {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 42px 10px 12px;
  text-align: left;
  outline: none;
}

.custom-select-button:focus,
.custom-select.open .custom-select-button {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 145, 67, 0.16);
}

.custom-select.open .custom-select-button {
  background: #fffaf0;
}

.custom-select-chevron {
  position: absolute;
  right: 15px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.16s ease;
}

.custom-select.open .custom-select-chevron {
  transform: translateY(-35%) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  display: none;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(185, 145, 67, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(31, 29, 24, 0.16);
  padding: 6px;
}

.custom-select.open .custom-select-menu {
  display: grid;
}

.custom-select-option {
  position: relative;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 9px 12px 9px 38px;
  text-align: left;
  font-weight: 800;
}

.custom-select-option:hover,
.custom-select-option:focus {
  background: var(--gold-soft);
  outline: none;
}

.custom-select-option.selected {
  background: var(--black);
  color: #fff;
}

.custom-select-option.selected::before {
  content: "✓";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-soft);
  font-weight: 900;
}

.modal .custom-select-menu {
  z-index: 90;
}

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

.form-grid.three {
  grid-template-columns: 1.1fr 1fr 1fr;
}

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

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

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

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

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
}

.btn-text {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px;
  font-weight: 800;
}

.error {
  display: none;
  border: 1px solid rgba(184, 75, 64, 0.28);
  border-radius: var(--radius);
  background: var(--red-soft);
  color: var(--red);
  padding: 10px 12px;
  font-size: 14px;
}

.error.visible {
  display: block;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(227, 223, 212, 0.76);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
  padding: 24px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  text-align: left;
  font-weight: 800;
}

.nav-button.active {
  border-color: rgba(185, 145, 67, 0.24);
  background: var(--gold-soft);
  color: var(--ink);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.nav-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.side-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.user-mini {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.user-mini strong,
.user-mini span {
  display: block;
}

.user-mini span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-title h1 {
  margin: 0 0 6px;
  font-size: 34px;
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.dashboard-grid > *,
.admin-grid > *,
.stack {
  min-width: 0;
}

.stack > *,
.panel,
.summary-panel,
.table-wrap {
  min-width: 0;
  max-width: 100%;
}

.summary-panel,
.panel,
.stat-card,
.fund-card,
.history-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(31, 29, 24, 0.06);
}

.summary-panel {
  overflow: hidden;
}

.summary-head {
  padding: 24px;
  background: linear-gradient(135deg, #171717 0%, #26231c 100%);
  color: #fff;
}

.summary-head .muted {
  color: rgba(255, 255, 255, 0.66);
}

.capital-number {
  margin: 8px 0 0;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 900;
  line-height: 1;
}

.capital-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.capital-rate {
  min-width: 96px;
  border: 1px solid rgba(239, 227, 199, 0.28);
  border-radius: var(--radius);
  background: rgba(239, 227, 199, 0.12);
  padding: 10px 12px;
  text-align: right;
}

.capital-rate span {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.capital-rate strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 24px;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-stats .stat {
  padding: 18px 24px;
  border-right: 1px solid var(--line);
}

.summary-stats .stat:last-child {
  border-right: 0;
}

.stat span,
.card-label,
.table-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.privacy-eye {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  margin-top: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  padding: 0;
}

.privacy-eye:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.privacy-eye .nav-icon {
  width: 22px;
  height: 22px;
}

.credit-lines {
  display: grid !important;
  gap: 4px;
  line-height: 1.18;
}

.credit-lines span {
  display: block;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
}

.panel {
  padding: 20px;
}

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

.panel-header h2,
.panel-header h3 {
  margin: 0;
}

.fund-list {
  display: grid;
  gap: 12px;
}

.fund-card {
  padding: 16px;
}

.fund-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.fund-row h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.fund-amount {
  text-align: right;
  font-weight: 900;
  white-space: nowrap;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e3d8;
  margin-top: 14px;
}

.progress div {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.fund-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 18px;
}

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

.quick-result {
  border: 1px solid rgba(12, 111, 92, 0.2);
  border-radius: var(--radius);
  background: var(--green-soft);
  padding: 14px;
}

.quick-result strong {
  display: block;
  margin-top: 5px;
  font-size: 28px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

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

tr:last-child td {
  border-bottom: 0;
}

.number {
  text-align: right;
  white-space: nowrap;
}

.history-table-wrap th:first-child,
.history-table-wrap td:first-child {
  min-width: 126px;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #6f5015;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.green {
  background: var(--green-soft);
  color: var(--green);
}

.table-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.table-sub.inline {
  display: inline;
  margin-top: 0;
  white-space: nowrap;
}

.money-green {
  color: var(--green);
}

.money-red {
  color: var(--red);
}

.loan-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.loan-stat strong {
  font-size: 20px;
}

.loan-stat.green {
  border-color: rgba(12, 111, 92, 0.22);
  background: var(--green-soft);
}

.loan-stat.red {
  border-color: rgba(184, 75, 64, 0.22);
  background: var(--red-soft);
}

.loans-table-wrap {
  border-color: rgba(185, 145, 67, 0.24);
}

.loan-table {
  min-width: 1680px;
}

.loan-summary-row td {
  border-bottom: 2px solid rgba(185, 145, 67, 0.42);
  background: #f8f1df;
  color: var(--ink);
  font-weight: 900;
}

.loan-bank-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

.loan-bank-badge > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(16, 16, 15, 0.08);
  border-radius: var(--radius);
  background: var(--black);
  color: var(--gold-soft);
  font-size: 12px;
}

.loan-bank-badge.bank-halyk > span,
.loan-bank-badge.bank-bcc > span {
  background: var(--green);
  color: #fff;
}

.loan-bank-badge.bank-home-credit > span {
  background: var(--red);
  color: #fff;
}

.loan-bank-badge.bank-kaspi > span {
  background: #ef3d32;
  color: #fff;
}

.loan-bank-badge.bank-forte > span,
.loan-bank-badge.bank-jusan > span,
.loan-bank-badge.bank-bereke > span {
  background: var(--gold);
  color: #fff;
}

.loan-bank-badge.bank-cashdrive > span {
  background: #26312f;
  color: var(--gold-soft);
}

.loan-bank-badge.bank-freedom > span {
  background: #1f6f5f;
  color: #fff;
}

.loan-person-badge {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: #6f5015;
  font-weight: 900;
}

.loan-payments {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-weight: 900;
}

.loan-payments span + span::before {
  content: "/";
  margin-right: 5px;
  color: var(--muted);
  font-weight: 700;
}

.icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  padding: 0;
}

.icon-btn:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.icon-btn.danger {
  color: var(--red);
}

.icon-btn .nav-icon {
  width: 18px;
  height: 18px;
}

.loan-card-list {
  display: none;
}

.loan-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.loan-card-head,
.loan-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.loan-card-main {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.loan-card-main strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.loan-card-comment {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

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

.loan-card-grid div {
  min-width: 0;
}

.loan-card-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.loan-card-grid strong {
  display: block;
  margin-top: 3px;
  word-break: break-word;
}

.modal-wide {
  width: min(980px, 100%);
}

.loan-modal-grid {
  align-items: start;
}

.field input[readonly] {
  background: #f3f1eb;
  color: var(--muted);
}

.loan-form-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(185, 145, 67, 0.24);
  border-radius: var(--radius);
  background: #fbf6eb;
  padding: 12px;
}

.loan-form-preview strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.analytics-table {
  min-width: 620px;
}

.analytics-card-list {
  display: none;
}

.analytics-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.analytics-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.analytics-card-grid strong {
  display: block;
  margin-top: 4px;
}

.permission-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
  padding: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.stack {
  display: grid;
  gap: 18px;
}

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

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

.list-item strong,
.list-item span {
  display: block;
}

.list-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

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

.plan-item {
  display: grid;
  gap: 6px;
}

.plan-item label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.plan-item input {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(16, 16, 15, 0.42);
  padding: 18px;
}

.modal-backdrop.visible {
  display: flex;
}

.modal {
  width: min(620px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
}

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

.modal-head h2 {
  margin: 0;
}

.bottom-nav {
  display: none;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.hide {
  display: none !important;
}

@media (max-width: 1100px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 46vh;
  }

  .auth-panel {
    min-height: auto;
  }

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar .nav,
  .side-footer {
    display: none;
  }

  .dashboard-grid,
  .admin-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  body {
    background: #f7f6f2;
  }

  .auth-visual {
    min-height: 38vh;
    padding: 26px;
  }

  .auth-title h1 {
    font-size: 40px;
  }

  .auth-title p,
  .auth-metrics {
    display: none;
  }

  .auth-panel {
    padding: 0;
  }

  .auth-card {
    padding: 22px;
  }

  .main {
    padding: 18px 14px 92px;
  }

  .topbar {
    align-items: flex-start;
  }

  .section-title h1 {
    font-size: 28px;
  }

  .summary-head,
  .summary-stats {
    grid-template-columns: 1fr;
  }

  .summary-stats .stat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-stats .stat:last-child {
    border-bottom: 0;
  }

  .capital-row {
    align-items: center;
  }

  .capital-rate {
    flex: 0 0 auto;
    text-align: right;
  }

  .stat-grid,
  .loan-summary-grid,
  .form-grid,
  .form-grid.three,
  .loan-form-preview,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .fund-row {
    display: grid;
  }

  .fund-amount {
    text-align: left;
  }

  .panel {
    padding: 16px;
  }

  .loans-table-wrap {
    display: none;
  }

  .analytics-table-wrap {
    display: none;
  }

  .loan-card-list {
    display: grid;
    gap: 12px;
  }

  .analytics-card-list {
    display: grid;
    gap: 12px;
  }

  .analytics-card-grid {
    grid-template-columns: 1fr;
  }

  .loan-card-head {
    align-items: flex-start;
  }

  .loan-bank-badge strong {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  .modal,
  .modal-wide {
    width: 100%;
    max-height: 88vh;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 16px;
  }

  .bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(var(--bottom-nav-items, 6), minmax(0, 1fr));
    gap: 4px;
    border: 1px solid rgba(207, 199, 184, 0.8);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    padding: 6px;
  }

  .bottom-nav .nav-button {
    width: 100%;
    min-height: 50px;
    display: grid;
    place-items: center;
    gap: 0;
    padding: 8px 4px;
    font-size: 0;
  }

  .bottom-nav .nav-button span:not(.nav-icon) {
    display: none;
  }

  .bottom-nav .nav-icon {
    width: 22px;
    height: 22px;
    margin: 0;
  }

  .button-row .btn,
  .form .btn {
    width: 100%;
  }
}
