/* ==========================================================================
   RSU SACCO — interface system
   A warm, editorial take on co-operative finance software.
   ========================================================================== */

:root {
  --forest-950: #071f19;
  --forest-900: #0b2d24;
  --forest-850: #0e362b;
  --forest-800: #114333;
  --forest-700: #195941;
  --forest-600: #256f54;
  --sage-600: #5f8d79;
  --sage-400: #9bb9aa;
  --sage-200: #d5e3db;
  --lime: #d4f26b;
  --lime-soft: #e7f8ab;
  --lime-deep: #b8d942;
  --canvas: #f2f4ee;
  --canvas-deep: #e9ede3;
  --paper: #fbfcf8;
  --white: #ffffff;
  --ink: #14251f;
  --ink-soft: #33443d;
  --muted: #6c7c74;
  --muted-light: #8e9c95;
  --line: #e1e7dd;
  --line-strong: #ccd7cc;
  --amber: #e4a852;
  --amber-soft: #f6e8cf;
  --rust: #cf6a4c;
  --rust-soft: #f6ded5;
  --danger: #b6483f;
  --danger-soft: #f8e1dd;
  --blue: #4e7e93;
  --blue-soft: #deedf3;
  --plum: #76546f;
  --plum-soft: #eee2eb;
  --shadow-sm: 0 1px 2px rgba(18, 37, 31, 0.04), 0 2px 8px rgba(18, 37, 31, 0.03);
  --shadow-md: 0 12px 30px -18px rgba(12, 44, 34, 0.26), 0 4px 10px rgba(12, 44, 34, 0.03);
  --shadow-lg: 0 30px 70px -32px rgba(7, 31, 25, 0.45), 0 8px 24px -12px rgba(7, 31, 25, 0.12);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sidebar-width: 264px;
  --topbar-height: 78px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

svg {
  display: block;
}

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

::selection {
  background: var(--lime);
  color: var(--forest-950);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c6d1c7;
  border: 3px solid var(--canvas);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #aab9ad;
}

:focus-visible {
  outline: 3px solid rgba(37, 111, 84, 0.38);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.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;
}

/* --------------------------------------------------------------------------
   Boot
   -------------------------------------------------------------------------- */

.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at 20% 20%, rgba(212, 242, 107, 0.1), transparent 32%),
    var(--forest-900);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.boot-mark {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  animation: boot-rise 700ms var(--ease) both;
}

.boot-mark svg {
  width: 100%;
  height: 100%;
}

.boot-line {
  width: 96px;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

.boot-line i {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--lime);
  border-radius: inherit;
  animation: boot-slide 1.15s ease-in-out infinite;
}

@keyframes boot-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

@keyframes boot-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(340%); }
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(480px, 1.08fr) minmax(460px, 0.92fr);
  background: #f4f3ec;
}

.auth-story {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 46px 56px 42px;
  background:
    radial-gradient(circle at 88% 16%, rgba(212, 242, 107, 0.2), transparent 28%),
    radial-gradient(circle at 10% 85%, rgba(95, 141, 121, 0.45), transparent 38%),
    linear-gradient(145deg, #0b2d24 0%, #0c362a 55%, #08251d 100%);
  color: #f6f5ed;
}

.auth-story::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 620px;
  height: 620px;
  right: -280px;
  top: -230px;
  border: 1px solid rgba(212, 242, 107, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 90px rgba(212, 242, 107, 0.025), 0 0 0 180px rgba(212, 242, 107, 0.018);
}

.auth-story::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 340px;
  height: 340px;
  left: -180px;
  bottom: -130px;
  border-radius: 50%;
  background: rgba(212, 242, 107, 0.06);
  filter: blur(2px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
}

.auth-brand .brand-mark {
  width: 42px;
  height: 42px;
}

.auth-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auth-brand span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.auth-story-main {
  margin: auto 0;
  padding: 68px 0 54px;
  max-width: 640px;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 26px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(212, 242, 107, 0.13);
}

.auth-story h1 {
  font-family: var(--font-display);
  font-size: clamp(58px, 5.5vw, 88px);
  font-weight: 530;
  line-height: 0.94;
  letter-spacing: -0.065em;
  max-width: 680px;
}

.auth-story h1 em {
  display: block;
  color: var(--lime);
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.auth-lede {
  max-width: 460px;
  margin-top: 30px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 15px;
  line-height: 1.75;
}

.auth-impact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 560px;
  margin-top: 46px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-impact > div {
  padding: 20px 22px 20px 0;
}

.auth-impact > div + div {
  padding-left: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-impact strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.auth-impact span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-story-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  max-width: 650px;
  margin-top: auto;
}

.auth-quote {
  max-width: 380px;
  padding-left: 16px;
  border-left: 2px solid var(--lime);
}

.auth-quote p {
  color: rgba(255, 255, 255, 0.76);
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  line-height: 1.55;
}

.auth-quote span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-version {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-form-side {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
  background:
    radial-gradient(circle at 100% 0%, rgba(212, 242, 107, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f6f0, #f2f1e9);
}

.auth-card {
  width: 100%;
  max-width: 448px;
  animation: auth-in 700ms var(--ease) both;
}

@keyframes auth-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 99px;
  background: var(--forest-900);
  color: var(--lime);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-card h2 {
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 550;
  letter-spacing: -0.05em;
  line-height: 1;
}

.auth-card .auth-sub {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

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

.field label,
.field-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > .icon {
  position: absolute;
  left: 15px;
  color: var(--muted-light);
  pointer-events: none;
}

.input-wrap input {
  padding-left: 44px;
}

.input-wrap .input-action {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.input-wrap .input-action:hover {
  background: var(--canvas-deep);
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #97a59d;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b8c7ba;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--forest-600);
  box-shadow: 0 0 0 4px rgba(37, 111, 84, 0.09);
}

textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.55;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%236c7c74' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

.auth-form input {
  min-height: 50px;
  background: rgba(255, 255, 255, 0.8);
}

.auth-forgot {
  color: var(--forest-700);
  font-size: 11px;
  font-weight: 600;
}

.auth-forgot:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-submit {
  min-height: 50px;
  margin-top: 3px;
  justify-content: space-between;
  padding: 0 10px 0 20px;
  border-radius: 12px;
  background: var(--forest-900);
  color: #fff;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: 0 14px 30px -18px rgba(7, 31, 25, 0.8);
}

.auth-submit:hover {
  background: var(--forest-800);
  transform: translateY(-1px);
}

.btn.auth-submit {
  min-height: 50px;
  margin-top: 3px;
  justify-content: space-between;
  padding: 0 10px 0 20px;
  border-radius: 12px;
  background: var(--forest-900);
  color: #fff;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: 0 14px 30px -18px rgba(7, 31, 25, 0.8);
}

.btn.auth-submit:hover {
  background: var(--forest-800);
  color: #fff;
  transform: translateY(-1px);
}

.auth-submit .submit-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--lime);
  color: var(--forest-950);
  transition: transform 180ms var(--ease);
}

.auth-submit:hover .submit-arrow {
  transform: translateX(2px);
}

.auth-error {
  display: none;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid #ebc4bd;
  border-radius: 10px;
  background: #fbebe8;
  color: #8b3b32;
  font-size: 12px;
  line-height: 1.45;
}

.auth-error.visible {
  display: flex;
  animation: shake 340ms ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.demo-divider {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 28px 0 14px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.demo-divider::before,
.demo-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.demo-access {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
}

.demo-access-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.demo-access-head span:last-child {
  color: var(--forest-700);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 150ms ease;
}

.demo-row:last-child {
  border-bottom: 0;
}

.demo-row:hover {
  background: var(--white);
}

.demo-row .mini-avatar {
  width: 30px;
  height: 30px;
  font-size: 10px;
}

.demo-row-text {
  flex: 1;
  min-width: 0;
}

.demo-row-text strong {
  display: block;
  font-size: 11px;
  font-weight: 650;
}

.demo-row-text span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.demo-row .demo-enter {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: var(--canvas-deep);
  color: var(--forest-700);
}

.demo-row:hover .demo-enter {
  background: var(--lime);
  color: var(--forest-950);
}

.auth-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 24px;
  color: var(--muted-light);
  font-size: 10px;
}

.auth-security .icon {
  color: var(--sage-600);
}

/* --------------------------------------------------------------------------
   Shared brand + buttons
   -------------------------------------------------------------------------- */

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--forest-900);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.btn .icon {
  flex: 0 0 auto;
}

.btn-primary {
  background: var(--forest-900);
  color: #fff;
  box-shadow: 0 10px 24px -16px rgba(7, 31, 25, 0.7);
}

.btn-primary:hover {
  background: var(--forest-800);
}

.btn-lime {
  background: var(--lime);
  color: var(--forest-950);
  box-shadow: 0 8px 20px -14px rgba(184, 217, 66, 0.8);
}

.btn-lime:hover {
  background: var(--lime-soft);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: var(--white);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: #b9c7bb;
  background: #fdfdfb;
}

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

.btn-ghost:hover {
  background: rgba(17, 67, 51, 0.06);
  color: var(--ink);
}

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

.btn-danger:hover {
  background: #9e3b34;
}

.btn-soft-danger {
  border-color: #eccbc5;
  background: #fdf1ef;
  color: var(--danger);
}

.btn-soft-danger:hover {
  background: #fbebe7;
}

.btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
}

.btn-lg {
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: #fdfdfb;
  color: var(--forest-700);
}

.icon-btn.plain {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.icon-btn.plain:hover {
  background: rgba(17, 67, 51, 0.07);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--forest-700);
  font-size: 11px;
  font-weight: 650;
}

.text-link:hover {
  color: var(--forest-950);
}

.text-link .icon {
  transition: transform 160ms var(--ease);
}

.text-link:hover .icon {
  transform: translateX(2px);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -10%, rgba(212, 242, 107, 0.11), transparent 26%),
    var(--canvas);
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 10% 0%, rgba(212, 242, 107, 0.09), transparent 30%),
    linear-gradient(180deg, #0b2e24 0%, #09271f 100%);
  color: rgba(255, 255, 255, 0.72);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
}

.sidebar-brand .brand-mark {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar-brand strong {
  display: block;
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.sidebar-brand span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.org-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 2px 24px;
  padding: 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.org-symbol {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(212, 242, 107, 0.12);
  color: var(--lime);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.org-switcher-text {
  min-width: 0;
  flex: 1;
}

.org-switcher-text span {
  display: block;
  color: rgba(255, 255, 255, 0.34);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.org-switcher-text strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-live {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(212, 242, 107, 0.1);
}

.nav-group + .nav-group {
  margin-top: 22px;
}

.nav-label {
  padding: 0 12px;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.27);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 9px 11px;
  margin: 2px 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 500;
  transition: background 160ms ease, color 160ms ease;
}

.nav-link .icon {
  flex: 0 0 auto;
  opacity: 0.78;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.9);
}

.nav-link.active {
  background: rgba(212, 242, 107, 0.11);
  color: var(--lime);
  font-weight: 650;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 11px;
  bottom: 11px;
  width: 2px;
  border-radius: 99px;
  background: var(--lime);
}

.nav-link.active .icon {
  opacity: 1;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 99px;
  background: rgba(212, 242, 107, 0.13);
  color: var(--lime);
  font-size: 9px;
  font-weight: 750;
}

.nav-badge.alert {
  background: rgba(207, 106, 76, 0.2);
  color: #f3ae99;
}

.nav-soon {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.32);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 20px;
}

.sidebar-health {
  padding: 13px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-health-top {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.health-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(212, 242, 107, 0.1);
}

.sidebar-health p {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 9px;
  line-height: 1.45;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-radius: 11px;
  transition: background 160ms ease;
}

.sidebar-profile:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-profile .avatar {
  width: 32px;
  height: 32px;
  font-size: 10px;
}

.sidebar-profile-text {
  min-width: 0;
  flex: 1;
}

.sidebar-profile-text strong {
  display: block;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile-text span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile .icon {
  color: rgba(255, 255, 255, 0.3);
}

.main-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(207, 216, 206, 0.72);
  background: rgba(244, 246, 240, 0.84);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.mobile-menu {
  display: none;
}

.topbar-search {
  position: relative;
  width: min(390px, 38vw);
}

.topbar-search > .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-light);
  pointer-events: none;
}

.topbar-search input {
  height: 40px;
  min-height: 40px;
  padding: 8px 48px 8px 39px;
  border-color: transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(207, 216, 206, 0.7);
  font-size: 12px;
}

.topbar-search input:focus {
  background: #fff;
  border-color: transparent;
  box-shadow: inset 0 0 0 1px var(--forest-600), 0 0 0 4px rgba(37, 111, 84, 0.08);
}

.topbar-search kbd {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--paper);
  color: var(--muted-light);
  font-family: var(--font-sans);
  font-size: 9px;
}

.search-results {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.search-results-head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.search-result:hover {
  background: #f7f9f4;
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result-text {
  min-width: 0;
  flex: 1;
}

.search-result-text strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-text span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
}

.search-empty {
  padding: 18px 14px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.topbar-spacer {
  flex: 1;
}

.topbar-date {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-date .icon {
  color: var(--sage-600);
}

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

.notification-button {
  position: relative;
}

.notification-button::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 0 2px var(--canvas);
}

.notifications-panel,
.user-panel {
  position: absolute;
  z-index: 80;
  top: calc(var(--topbar-height) - 9px);
  right: 30px;
  width: 340px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  animation: pop-in 180ms var(--ease);
}

.user-panel {
  width: 240px;
  right: 30px;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.panel-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-pop-head strong {
  font-size: 12px;
  font-weight: 700;
}

.panel-pop-head span {
  color: var(--muted);
  font-size: 9px;
}

.notification-item {
  display: flex;
  gap: 11px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.notification-item:hover {
  background: #f8faf5;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--amber-soft);
  color: #9b6b25;
}

.notification-icon.risk {
  background: var(--rust-soft);
  color: var(--rust);
}

.notification-icon.kyc {
  background: var(--blue-soft);
  color: var(--blue);
}

.notification-text strong {
  display: block;
  font-size: 10px;
  font-weight: 650;
}

.notification-text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.notifications-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.user-panel-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.user-panel-head strong {
  display: block;
  font-size: 12px;
}

.user-panel-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.user-panel a,
.user-panel button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  text-align: left;
}

.user-panel a:hover,
.user-panel button:hover {
  background: #f8faf5;
  color: var(--ink);
}

.user-panel a:last-child,
.user-panel button:last-child {
  border-bottom: 0;
}

.user-panel .danger-text {
  color: var(--danger);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
}

.user-chip .avatar {
  width: 30px;
  height: 30px;
  font-size: 9px;
}

.user-chip .icon {
  margin-right: 3px;
  color: var(--muted);
}

.content {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: 30px 32px 64px;
}

.mobile-overlay {
  display: none;
}

/* --------------------------------------------------------------------------
   Avatars and badges
   -------------------------------------------------------------------------- */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--forest-800);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.avatar.tone-1 { background: #dce9c9; color: #3e5b32; }
.avatar.tone-2 { background: #f1dfc8; color: #7a5528; }
.avatar.tone-3 { background: #dbe7ef; color: #3f6478; }
.avatar.tone-4 { background: #eadde7; color: #694863; }
.avatar.tone-5 { background: #d6e7df; color: #2f5f4b; }
.avatar.tone-6 { background: #eee3c4; color: #6d5b28; }
.avatar.lg {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  font-size: 17px;
}
.avatar.xl {
  width: 70px;
  height: 70px;
  border-radius: 19px;
  font-size: 21px;
}
.avatar.sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 9px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--canvas-deep);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.65;
}

.badge.active,
.badge.completed,
.badge.good {
  background: #e6f2e8;
  color: #346b46;
}

.badge.dormant,
.badge.pending,
.badge.approved {
  background: #f6ecd9;
  color: #8c6729;
}

.badge.overdue,
.badge.rejected,
.badge.suspended {
  background: #f8e2dc;
  color: #9e4634;
}

.badge.exited {
  background: #e9ece8;
  color: #67736b;
}

.badge.role {
  background: #e8eee7;
  color: var(--forest-700);
}

.badge.role.founder {
  background: var(--forest-900);
  color: var(--lime);
}

.badge.outline {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
}

.badge.no-dot::before {
  display: none;
}

.risk-pill {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 750;
}

.risk-pill.A { background: #e5f2e7; color: #2f6a43; }
.risk-pill.B { background: #e8f0dd; color: #5e7234; }
.risk-pill.C { background: #f7ecd6; color: #936826; }
.risk-pill.D { background: #f8e2db; color: #9c4332; }

/* --------------------------------------------------------------------------
   Page headings
   -------------------------------------------------------------------------- */

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage-600);
}

.eyebrow.live .dot {
  background: var(--forest-600);
  box-shadow: 0 0 0 3px rgba(37, 111, 84, 0.1);
}

.page-heading h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 560;
  letter-spacing: -0.05em;
  line-height: 1.04;
}

.page-heading h1 em {
  color: var(--forest-600);
  font-family: var(--font-serif);
  font-weight: 400;
}

.page-heading .page-sub {
  max-width: 580px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-bottom: 2px;
}

/* --------------------------------------------------------------------------
   Cards + stats
   -------------------------------------------------------------------------- */

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

.stat-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 151px;
  padding: 17px 18px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.stat-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 130px;
  height: 130px;
  right: -55px;
  bottom: -75px;
  border-radius: 50%;
  background: var(--stat-tint, rgba(37, 111, 84, 0.08));
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--stat-accent, var(--forest-600));
  opacity: 0.7;
}

.stat-card.members { --stat-tint: rgba(37, 111, 84, 0.09); --stat-accent: #2b7359; }
.stat-card.savings { --stat-tint: rgba(78, 126, 147, 0.1); --stat-accent: #4e7e93; }
.stat-card.credit { --stat-tint: rgba(228, 168, 82, 0.13); --stat-accent: #c38a35; }
.stat-card.risk { --stat-tint: rgba(207, 106, 76, 0.1); --stat-accent: #cf6a4c; }

.stat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--forest-700);
}

.stat-card.savings .stat-icon { color: var(--blue); }
.stat-card.credit .stat-icon { color: #a36e1e; }
.stat-card.risk .stat-icon { color: var(--rust); }

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 6px;
  background: #e8f2e6;
  color: #3d714e;
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.stat-trend.neutral {
  background: var(--canvas-deep);
  color: var(--muted);
}

.stat-trend.warn {
  background: var(--rust-soft);
  color: var(--rust);
}

.stat-label {
  margin-top: 13px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.stat-value {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.3vw, 31px);
  font-weight: 570;
  letter-spacing: -0.055em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat-value .unit {
  margin-right: 3px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.stat-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
}

.stat-foot strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.mini-spark {
  width: 65px;
  height: 22px;
  flex: 0 0 auto;
  opacity: 0.75;
}

.mini-spark path {
  fill: none;
  stroke: var(--stat-accent, var(--forest-600));
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-spark .spark-fill {
  fill: var(--stat-tint, rgba(37, 111, 84, 0.1));
  stroke: none;
}

/* --------------------------------------------------------------------------
   Panels + dashboard
   -------------------------------------------------------------------------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 19px 14px;
}

.panel-head.bordered {
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.panel-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.panel-body {
  padding: 0 19px 19px;
}

.panel-body.flush {
  padding: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.95fr) minmax(290px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

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

.chart-panel {
  min-height: 354px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.legend-swatch {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--forest-700);
}

.legend-swatch.alt {
  background: var(--amber);
}

.period-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.chart-wrap {
  width: 100%;
  padding: 3px 9px 0;
}

.chart-wrap svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-label {
  fill: #96a49c;
  font-family: var(--font-sans);
  font-size: 9px;
}

.chart-axis-line {
  stroke: #e7ece4;
  stroke-width: 1;
}

.chart-grid-line {
  stroke: #eef1eb;
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.chart-bar-savings {
  fill: #2c6d55;
  opacity: 0.9;
}

.chart-bar-loans {
  fill: #e4a852;
  opacity: 0.88;
}

.chart-bar-group:hover .chart-bar-savings,
.chart-bar-group:hover .chart-bar-loans {
  opacity: 1;
}

.chart-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding: 9px 10px 0;
  border-top: 1px dashed var(--line);
  color: var(--muted-light);
  font-size: 8.5px;
}

.chart-note strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.chart-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 10px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.chart-insights > div {
  padding: 9px 11px;
  background: #f9fbf6;
}

.chart-insights span {
  display: block;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 600;
}

.chart-insights strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 580;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.chart-insights em {
  display: block;
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 7px;
  font-style: normal;
}

.risk-panel {
  display: flex;
  flex-direction: column;
}

.risk-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1px 19px 19px;
}

.donut-wrap {
  position: relative;
  width: 156px;
  height: 156px;
  margin: 7px auto 18px;
}

.donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 21px), #000 calc(100% - 20px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 21px), #000 calc(100% - 20px));
  transform: rotate(-35deg);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.donut-center span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.donut-center strong {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 580;
  letter-spacing: -0.05em;
}

.donut-center em {
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.risk-legend {
  display: grid;
  gap: 8px;
}

.risk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
}

.risk-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.risk-row strong {
  font-weight: 700;
}

.risk-row .risk-name {
  flex: 1;
  color: var(--muted);
}

.risk-row .risk-amount {
  color: var(--ink-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.risk-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.risk-foot .icon {
  flex: 0 0 auto;
  color: var(--forest-600);
}

/* Activity + actions */

.activity-panel {
  overflow: hidden;
}

.activity-list {
  display: grid;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 19px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: background 150ms ease;
  cursor: pointer;
}

.activity-item:hover {
  background: #f8faf5;
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: #e7f1e9;
  color: var(--forest-700);
}

.activity-icon.out {
  background: #f7e6df;
  color: var(--rust);
}

.activity-icon.credit {
  background: #f6ecd9;
  color: #a27128;
}

.activity-icon.neutral {
  background: var(--blue-soft);
  color: var(--blue);
}

.activity-main {
  min-width: 0;
  flex: 1;
}

.activity-main strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-main span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-amount {
  flex: 0 0 auto;
  text-align: right;
}

.activity-amount strong {
  display: block;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.activity-amount span {
  display: block;
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 8px;
}

.action-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 90% 0%, rgba(212, 242, 107, 0.16), transparent 38%),
    linear-gradient(145deg, #0d382b, #09281f);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.action-panel::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -150px;
  bottom: -170px;
  border: 1px solid rgba(212, 242, 107, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(212, 242, 107, 0.025);
}

.action-head {
  position: relative;
  z-index: 1;
  padding: 18px 19px 14px;
}

.action-head .eyebrow {
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 7px;
}

.action-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 550;
  letter-spacing: -0.035em;
}

.action-head p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 9px;
  line-height: 1.5;
}

.action-list {
  position: relative;
  z-index: 1;
  display: grid;
  padding: 0 9px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: transparent;
  color: #fff;
  text-align: left;
  border-radius: 8px;
  transition: background 150ms ease;
}

.action-row:hover {
  background: rgba(255, 255, 255, 0.045);
}

.action-row-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--lime);
}

.action-row-text {
  min-width: 0;
  flex: 1;
}

.action-row-text strong {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
}

.action-row-text span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 8px;
}

.action-row .action-count {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.action-footer {
  position: relative;
  z-index: 1;
  padding: 12px 19px 18px;
}

.action-footer .btn {
  background: var(--lime);
  color: var(--forest-950);
}

.action-footer .btn:hover {
  background: var(--lime-soft);
}

/* --------------------------------------------------------------------------
   Tables, filters, pagination
   -------------------------------------------------------------------------- */

.table-panel {
  overflow: hidden;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.toolbar-search {
  position: relative;
  flex: 1 1 220px;
  max-width: 340px;
}

.toolbar-search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-light);
  pointer-events: none;
}

.toolbar-search input {
  min-height: 36px;
  padding: 8px 12px 8px 36px;
  border-color: var(--line);
  background: #fafbf7;
  font-size: 11px;
}

.toolbar select {
  width: auto;
  min-height: 36px;
  padding: 7px 32px 7px 10px;
  border-color: var(--line);
  background-color: #fafbf7;
  font-size: 10px;
  font-weight: 550;
}

.toolbar-spacer {
  flex: 1;
}

.filter-pills {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8faf5;
}

.filter-pill {
  min-height: 29px;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.filter-pill:hover {
  color: var(--ink);
}

.filter-pill.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(18, 37, 31, 0.1);
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.results-meta strong {
  color: var(--ink-soft);
  font-weight: 650;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table thead th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8faf5;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #edf0e9;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 130ms ease;
}

.data-table tbody tr[data-member-id] {
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: #f8faf5;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.cell-member {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 165px;
}

.cell-member-text {
  min-width: 0;
}

.cell-member-text strong {
  display: block;
  overflow: hidden;
  max-width: 210px;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 650;
  text-overflow: ellipsis;
}

.cell-member-text span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8.5px;
}

.cell-mono {
  color: var(--muted);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.cell-amount {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.cell-amount.positive {
  color: var(--forest-700);
}

.cell-amount.negative {
  color: var(--rust);
}

.cell-secondary {
  color: var(--muted);
  font-size: 9px;
}

.cell-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.row-arrow {
  color: var(--muted-light);
  transition: transform 150ms ease, color 150ms ease;
}

tr:hover .row-arrow {
  color: var(--forest-700);
  transform: translateX(2px);
}

.transaction-type {
  display: flex;
  align-items: center;
  gap: 8px;
}

.type-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #e8f2e9;
  color: var(--forest-700);
}

.type-icon.out {
  background: var(--rust-soft);
  color: var(--rust);
}

.type-icon.credit {
  background: var(--amber-soft);
  color: #9b6b25;
}

.type-icon.neutral {
  background: var(--blue-soft);
  color: var(--blue);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 240px;
  padding: 30px;
  text-align: center;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--canvas-deep);
  color: var(--muted);
}

.empty-state strong {
  font-size: 12px;
}

.empty-state p {
  max-width: 300px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.pagination-info {
  color: var(--muted);
  font-size: 9px;
}

.pagination-info strong {
  color: var(--ink-soft);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: grid;
  place-items: center;
  min-width: 29px;
  height: 29px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--ink);
}

.page-btn.active {
  border-color: var(--forest-900);
  background: var(--forest-900);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--muted-light);
  font-size: 9px;
}

/* --------------------------------------------------------------------------
   Savings / loans page extras
   -------------------------------------------------------------------------- */

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.mini-stat {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.73);
  box-shadow: var(--shadow-sm);
}

.mini-stat-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--canvas-deep);
  color: var(--forest-700);
}

.mini-stat-icon.amber { background: var(--amber-soft); color: #9a6a25; }
.mini-stat-icon.rust { background: var(--rust-soft); color: var(--rust); }
.mini-stat-icon.blue { background: var(--blue-soft); color: var(--blue); }

.mini-stat-text span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.mini-stat-text strong {
  display: block;
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 580;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

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

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.note-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.note-card h3 {
  font-size: 11px;
  font-weight: 700;
}

.note-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.note-card .btn {
  margin-top: 12px;
}

.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.quick-amount {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.quick-amount:hover {
  border-color: var(--sage-400);
  color: var(--forest-700);
}

/* --------------------------------------------------------------------------
   Forms + modals + drawers
   -------------------------------------------------------------------------- */

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(7, 24, 19, 0.58);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fade-in 160ms ease both;
}

.drawer-backdrop {
  justify-content: flex-end;
  padding: 0;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 580px);
  max-height: min(90vh, 860px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 19px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  animation: modal-in 260ms var(--ease) both;
}

.modal.lg { width: min(100%, 760px); }
.modal.sm { width: min(100%, 430px); }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.quick-grid {
  display: grid;
  gap: 7px;
}

.quick-tile {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.quick-tile:hover {
  transform: translateX(2px);
  border-color: var(--sage-400);
  background: var(--white);
}

.quick-tile-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--forest-900);
  color: var(--lime);
}

.quick-tile-text {
  flex: 1;
  min-width: 0;
}

.quick-tile-text strong {
  display: block;
  font-size: 10.5px;
  font-weight: 650;
}

.quick-tile-text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.quick-tile > .icon {
  color: var(--muted-light);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 21px 15px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: var(--canvas);
  color: var(--muted);
}

.modal-close:hover {
  background: var(--canvas-deep);
  color: var(--ink);
}

.modal-body {
  overflow-y: auto;
  padding: 20px 21px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 21px;
  border-top: 1px solid var(--line);
  background: #fbfcf8;
}

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

.form-grid .span-2 {
  grid-column: span 2;
}

.form-section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 2px;
  color: var(--forest-700);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-section-label:not(:first-child) {
  margin-top: 10px;
  padding-top: 15px;
  border-top: 1px dashed var(--line);
}

.form-help {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.4;
}

.form-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  grid-column: span 2;
  padding: 9px 11px;
  border: 1px solid #ebc4bd;
  border-radius: 8px;
  background: var(--danger-soft);
  color: #8b3b32;
  font-size: 10px;
}

.form-error.visible {
  display: flex;
}

.form-actions-note {
  margin-right: auto;
  color: var(--muted);
  font-size: 9px;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--canvas);
}

.segmented button {
  min-height: 31px;
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.segmented button.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(18, 37, 31, 0.11);
}

.segmented button.active.deposit {
  color: var(--forest-700);
}

.segmented button.active.withdrawal {
  color: var(--rust);
}

.member-picker {
  position: relative;
}

.member-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.member-search-results .search-result {
  padding: 9px 11px;
}

.member-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--sage-200);
  border-radius: 10px;
  background: #f5f9f2;
}

.member-selected .member-selected-text {
  flex: 1;
  min-width: 0;
}

.member-selected strong {
  display: block;
  font-size: 10px;
  font-weight: 650;
}

.member-selected span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8.5px;
}

.selected-balance {
  text-align: right;
}

.selected-balance span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.selected-balance strong {
  display: block;
  font-size: 10px;
  font-weight: 700;
}

.preview-box {
  padding: 12px 13px;
  border: 1px dashed var(--sage-200);
  border-radius: 10px;
  background: #f7faf4;
}

.preview-box .preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  color: var(--muted);
  font-size: 9.5px;
}

.preview-box .preview-row strong {
  color: var(--ink);
  font-weight: 650;
}

.preview-box .preview-row.total {
  margin-top: 5px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 650;
}

.preview-box .preview-row.total strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.04em;
}

/* Drawers */

.drawer {
  display: flex;
  flex-direction: column;
  width: min(100%, 580px);
  height: 100%;
  overflow: hidden;
  background: var(--white);
  box-shadow: -24px 0 60px rgba(7, 31, 25, 0.25);
  animation: drawer-in 320ms var(--ease) both;
}

@keyframes drawer-in {
  from { transform: translateX(40px); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

.drawer-hero {
  position: relative;
  overflow: hidden;
  padding: 20px 22px 18px;
  background:
    radial-gradient(circle at 92% 0%, rgba(212, 242, 107, 0.18), transparent 38%),
    linear-gradient(145deg, #0d382b, #09271f);
  color: #fff;
}

.drawer-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -120px;
  bottom: -155px;
  border: 1px solid rgba(212, 242, 107, 0.17);
  border-radius: 50%;
  box-shadow: 0 0 0 35px rgba(212, 242, 107, 0.025);
}

.drawer-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.drawer-top .icon-btn {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.drawer-top .icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.drawer-eyebrow {
  color: rgba(255, 255, 255, 0.42);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.drawer-identity {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 13px;
  align-items: center;
}

.drawer-identity .avatar {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--lime);
  font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.drawer-identity h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 550;
  letter-spacing: -0.04em;
}

.drawer-identity-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
}

.drawer-identity-meta .badge {
  background: rgba(212, 242, 107, 0.12);
  color: var(--lime);
}

.drawer-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.drawer-actions .btn {
  min-height: 32px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.84);
  box-shadow: none;
  font-size: 9.5px;
}

.drawer-actions .btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.drawer-actions .btn.lime {
  border-color: transparent;
  background: var(--lime);
  color: var(--forest-950);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 26px;
}

.drawer-tabs {
  display: flex;
  gap: 3px;
  margin: 0 0 17px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--canvas);
}

.drawer-tab {
  flex: 1;
  min-height: 30px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
}

.drawer-tab.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(18, 37, 31, 0.1);
}

.summary-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 17px;
}

.summary-tile {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.summary-tile span {
  display: block;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.summary-tile strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 570;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.summary-tile.risk strong {
  color: var(--rust);
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
}

.detail-item {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.detail-item:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.detail-item:nth-last-child(-n+2) {
  border-bottom: 0;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.detail-item strong {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 600;
  word-break: break-word;
}

.timeline {
  display: grid;
}

.timeline-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: #e8f2e9;
  color: var(--forest-700);
}

.timeline-icon.out { background: var(--rust-soft); color: var(--rust); }
.timeline-icon.credit { background: var(--amber-soft); color: #9b6b25; }

.timeline-main {
  min-width: 0;
  flex: 1;
}

.timeline-main strong {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
}

.timeline-main span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
}

.timeline-amount {
  text-align: right;
  font-size: 9.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.loan-mini-card {
  padding: 11px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

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

.loan-mini-head strong {
  font-size: 9.5px;
}

.loan-mini-values {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 8.5px;
}

.loan-mini-values strong {
  color: var(--ink);
  font-size: 9.5px;
}

.progress {
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--canvas-deep);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--forest-600);
}

.progress.warn > span { background: var(--amber); }
.progress.risk > span { background: var(--rust); }

/* Founder + report page */

.founder-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.9fr);
  gap: 30px;
  padding: 26px 28px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 80% 20%, rgba(212, 242, 107, 0.16), transparent 32%),
    linear-gradient(140deg, #0c3327, #071f19);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.founder-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 470px;
  height: 470px;
  right: -210px;
  bottom: -290px;
  border: 1px solid rgba(212, 242, 107, 0.15);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(212, 242, 107, 0.022), 0 0 0 140px rgba(212, 242, 107, 0.015);
}

.founder-hero-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.founder-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid rgba(212, 242, 107, 0.22);
  border-radius: 99px;
  background: rgba(212, 242, 107, 0.09);
  color: var(--lime);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.founder-hero h1 {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 530;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.founder-hero h1 em {
  color: var(--lime);
  font-family: var(--font-serif);
  font-weight: 400;
}

.founder-hero p {
  max-width: 500px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  line-height: 1.65;
}

.founder-id {
  display: flex;
  align-items: center;
  gap: 10px;
}

.founder-id .avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.founder-id strong {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
}

.founder-id span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 8px;
}

.founder-hero-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.authority-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--lime);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.authority-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.09);
}

.authority-stat {
  padding: 10px 8px;
  background: rgba(7, 31, 25, 0.2);
}

.authority-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 550;
  letter-spacing: -0.04em;
}

.authority-stat span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 7.5px;
}

.founder-hero-side .btn {
  background: var(--lime);
  color: var(--forest-950);
}

.founder-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 17px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow-sm);
}

.founder-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.founder-tab.active {
  background: var(--forest-900);
  color: #fff;
}

.founder-tab .count {
  margin-left: 4px;
  opacity: 0.6;
}

.founder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  gap: 14px;
}

.founder-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.staff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}

.staff-row:last-child {
  border-bottom: 0;
}

.staff-text {
  min-width: 0;
  flex: 1;
}

.staff-text strong {
  display: block;
  font-size: 10px;
  font-weight: 650;
}

.staff-text span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8.5px;
}

.staff-text strong .badge {
  display: inline-flex;
  width: auto;
  margin: 0 0 0 4px;
  vertical-align: middle;
  font-size: 7px;
}

.staff-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.staff-controls select {
  width: auto;
  min-height: 30px;
  padding: 4px 26px 4px 7px;
  border-color: var(--line);
  background-color: var(--paper);
  font-size: 8.5px;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
}

.session-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lime-deep);
  box-shadow: 0 0 0 3px rgba(184, 217, 66, 0.17);
}

.session-text {
  flex: 1;
  min-width: 0;
}

.session-text strong {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
}

.session-text span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-chip {
  padding: 2px 5px;
  border-radius: 4px;
  background: #e8f2e6;
  color: #3e6e4d;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.role-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}

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

.role-card h4 {
  font-size: 10px;
  font-weight: 700;
}

.role-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

.role-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 8px;
}

.role-perms span {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 7px;
  font-weight: 600;
}

.control-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.control-card:last-child {
  border-bottom: 0;
}

.control-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--canvas-deep);
  color: var(--forest-700);
}

.control-text {
  flex: 1;
  min-width: 0;
}

.control-text strong {
  display: block;
  font-size: 10px;
  font-weight: 650;
}

.control-text p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

.control-meta {
  margin-top: 5px;
  color: var(--muted-light);
  font-size: 7.5px;
}

.toggle {
  position: relative;
  width: 35px;
  height: 20px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: #cdd7ce;
  transition: background 180ms ease;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 200ms var(--ease);
}

.toggle.on {
  background: var(--forest-600);
}

.toggle.on::after {
  transform: translateX(15px);
}

.toggle.danger.on {
  background: var(--rust);
}

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

.db-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.db-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.db-stat span {
  display: block;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.db-stat strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 570;
  letter-spacing: -0.04em;
}

.db-health {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid #dbe9d6;
  border-radius: 10px;
  background: #f3f9ef;
}

.db-health .health-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #dff0d7;
  color: var(--forest-700);
}

.db-health strong {
  display: block;
  font-size: 9.5px;
  font-weight: 650;
}

.db-health span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
}

.audit-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}

.audit-row:last-child {
  border-bottom: 0;
}

.audit-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--canvas-deep);
  color: var(--muted);
}

.audit-icon.high {
  background: var(--amber-soft);
  color: #956523;
}

.audit-text {
  min-width: 0;
  flex: 1;
}

.audit-text strong {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
}

.audit-text p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.audit-time {
  flex: 0 0 auto;
  color: var(--muted-light);
  font-size: 7.5px;
  white-space: nowrap;
}

.backup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
}

.backup-row:last-child {
  border-bottom: 0;
}

.backup-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
}

.backup-text {
  flex: 1;
  min-width: 0;
}

.backup-text strong {
  display: block;
  overflow: hidden;
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-text span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
}

/* Reports */

.report-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 88% 20%, rgba(212, 242, 107, 0.14), transparent 30%),
    var(--forest-900);
  color: #fff;
}

.report-intro h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 540;
  letter-spacing: -0.04em;
}

.report-intro p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9.5px;
  line-height: 1.5;
}

.report-intro .btn {
  background: var(--lime);
  color: var(--forest-950);
  flex: 0 0 auto;
}

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

.report-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.report-card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
}

.report-card .report-card-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

.bar-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) 1.6fr auto;
  gap: 8px;
  align-items: center;
  font-size: 8.5px;
}

.bar-row .bar-label {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--canvas-deep);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--forest-600);
}

.bar-fill.amber { background: var(--amber); }
.bar-fill.rust { background: var(--rust); }

.bar-row strong {
  font-size: 8.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.membership-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 132px;
  margin-top: 15px;
  padding-top: 10px;
  border-bottom: 1px solid var(--line);
}

.membership-bar-group {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.membership-bar {
  width: 100%;
  max-width: 23px;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--sage-200);
  transition: background 160ms ease;
}

.membership-bar-group:hover .membership-bar {
  background: var(--forest-600);
}

.membership-bar-group span {
  color: var(--muted-light);
  font-size: 7px;
}

.report-library {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.report-download {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.report-download:hover {
  transform: translateY(-2px);
  border-color: var(--sage-400);
  background: var(--white);
}

.report-download .report-download-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--forest-700);
}

.report-download strong {
  display: block;
  font-size: 9.5px;
  font-weight: 650;
}

.report-download span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1.4;
}

/* Skeleton */

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #e7ece3;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.skeleton-title {
  width: 220px;
  height: 30px;
  margin-bottom: 10px;
}

.skeleton-sub {
  width: 320px;
  height: 12px;
}

.skeleton-card {
  height: 151px;
}

.skeleton-panel {
  height: 340px;
}

.skeleton-row {
  height: 14px;
  margin: 14px 0;
}

.skeleton-row.short {
  width: 55%;
}

/* Toasts */

#toast-root {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: var(--forest-900);
  color: #fff;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 280ms var(--ease) both;
}

.toast.leaving {
  animation: toast-out 230ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: rgba(212, 242, 107, 0.14);
  color: var(--lime);
}

.toast.error .toast-icon {
  background: rgba(207, 106, 76, 0.2);
  color: #f6b29e;
}

.toast-text strong {
  display: block;
  font-size: 10.5px;
  font-weight: 650;
}

.toast-text span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  line-height: 1.4;
}

/* Utility */

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

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

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

.nowrap {
  white-space: nowrap;
}

.mt-14 { margin-top: 14px; }
.mt-10 { margin-top: 10px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1320px) {
  .auth-story { padding: 40px 42px; }
  .auth-story h1 { font-size: clamp(54px, 5.4vw, 76px); }
  .content { padding: 28px 26px 56px; }
  .stat-value { font-size: 27px; }
  .report-library { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1150px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid,
  .dashboard-grid.bottom { grid-template-columns: 1fr; }
  .risk-panel { min-height: 0; }
  .risk-body { flex-direction: row; align-items: center; gap: 22px; }
  .donut-wrap { margin: 4px 0; flex: 0 0 150px; }
  .risk-legend { flex: 1; }
  .risk-foot { display: none; }
  .founder-grid { grid-template-columns: 1fr; }
  .page-grid { grid-template-columns: 1fr; }
  .side-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .auth-impact { grid-template-columns: repeat(3, 1fr); }
  .auth-story-foot { display: block; }
  .auth-version { display: none; }
}

@media (max-width: 980px) {
  :root { --sidebar-width: 0px; }
  .sidebar {
    width: 270px;
    transform: translateX(-102%);
    transition: transform 260ms var(--ease);
    box-shadow: 20px 0 60px rgba(7, 31, 25, 0.32);
  }
  .sidebar.open { transform: none; }
  .main-shell { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .mobile-overlay {
    position: fixed;
    z-index: 45;
    inset: 0;
    background: rgba(7, 24, 19, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  .mobile-overlay.open { display: block; }
  .topbar { padding: 0 22px; }
  .content { padding: 26px 22px 52px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-story { min-height: auto; padding: 34px 32px 40px; }
  .auth-story-main { padding: 48px 0 36px; }
  .auth-story h1 { font-size: 64px; }
  .auth-lede { margin-top: 22px; }
  .auth-impact { margin-top: 32px; }
  .auth-story-foot { display: none; }
  .auth-form-side { min-height: auto; padding: 44px 28px 60px; }
  .founder-hero { grid-template-columns: 1fr; }
  .founder-hero-side { max-width: 520px; }
  .topbar-date { display: none; }
}

@media (max-width: 760px) {
  .topbar { height: 66px; gap: 10px; padding: 0 15px; }
  :root { --topbar-height: 66px; }
  .topbar-search { flex: 1; width: auto; }
  .topbar-search kbd { display: none; }
  .topbar-search input { padding-right: 12px; }
  .topbar .user-chip { display: none; }
  .notifications-panel, .user-panel { right: 12px; width: min(340px, calc(100vw - 24px)); top: 60px; }
  .content { padding: 22px 15px 46px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .page-heading h1 { font-size: 31px; }
  .heading-actions { width: 100%; }
  .heading-actions .btn { flex: 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 142px; padding: 14px; }
  .stat-value { font-size: 23px; }
  .mini-stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .mini-stat { padding: 11px; }
  .mini-stat-text strong { font-size: 16px; }
  .toolbar { gap: 7px; padding: 11px; }
  .toolbar-search { max-width: none; flex-basis: 100%; }
  .toolbar select { flex: 1; }
  .filter-pills { width: 100%; overflow-x: auto; }
  .filter-pill { flex: 1; }
  .data-table thead th, .data-table tbody td { padding: 9px 11px; }
  .cell-member-text strong { max-width: 145px; }
  .hide-sm { display: none !important; }
  .side-panel { grid-template-columns: 1fr; }
  .risk-body { flex-direction: column; }
  .donut-wrap { flex: none; }
  .reports-grid { grid-template-columns: 1fr; }
  .report-library { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: 94vh; border-radius: 15px; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-foot { padding-left: 16px; padding-right: 16px; }
  .drawer { width: 100%; }
  .drawer-hero { padding: 16px; }
  .drawer-body { padding: 15px; }
  .summary-tiles { grid-template-columns: 1fr 1fr 1fr; }
  .founder-hero { padding: 20px; }
  .founder-tabs { border-radius: 9px; }
  .founder-tab { padding: 6px 11px; }
  .param-grid { grid-template-columns: 1fr; }
  .staff-row { flex-wrap: wrap; }
  .staff-controls { width: 100%; justify-content: flex-end; }
  .auth-story { padding: 26px 22px 32px; }
  .auth-story-main { padding: 37px 0 28px; }
  .auth-story h1 { font-size: 49px; }
  .auth-lede { font-size: 13px; }
  .auth-impact > div { padding: 14px 12px 14px 0; }
  .auth-impact > div + div { padding-left: 12px; }
  .auth-impact strong { font-size: 20px; }
  .auth-impact span { font-size: 7.5px; }
  .auth-form-side { padding: 32px 20px 50px; }
  .auth-card h2 { font-size: 34px; }
  .auth-quote { display: none; }
}

@media (max-width: 460px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 135px; }
  .mini-stats { grid-template-columns: 1fr; }
  .report-library { grid-template-columns: 1fr; }
  .summary-tiles { grid-template-columns: 1fr 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-item:nth-child(odd) { border-right: 0; }
  .detail-item:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .topbar-search { display: none; }
  .topbar-actions { margin-left: auto; }
  .heading-actions { flex-wrap: wrap; }
  .pagination { flex-direction: column; align-items: flex-start; }
  .filter-pill { padding: 5px 7px; font-size: 8px; }
  .auth-story h1 { font-size: 42px; }
  .auth-impact { grid-template-columns: 1fr 1fr 1fr; }
  .auth-impact strong { font-size: 16px; }
  .auth-impact span { font-size: 6.5px; }
  .demo-row { padding: 9px 10px; }
  .founder-hero-side { padding: 13px; }
}

/* Applications desk + guarantor OTP */

.desk-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #d9e5d1;
  border-radius: 13px;
  background:
    radial-gradient(circle at 95% 15%, rgba(212, 242, 107, 0.24), transparent 25%),
    #f6faee;
}

.desk-banner .avatar {
  flex: 0 0 auto;
}

.desk-banner-text {
  flex: 1;
  min-width: 0;
}

.desk-banner-text strong {
  display: block;
  color: var(--forest-800);
  font-size: 10.5px;
  font-weight: 700;
}

.desk-banner-text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

.otp-verification {
  padding: 13px;
  border: 1px solid #dbe5d7;
  border-radius: 11px;
  background: #f8faf4;
}

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

.otp-head strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
}

.otp-head span:not(.badge) {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

.otp-actions {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}

.otp-actions input {
  min-height: 34px;
  height: 34px;
  letter-spacing: 0.22em;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.otp-actions input:disabled {
  background: #eef2e9;
  color: #9ba79f;
}

.otp-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

.otp-status strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.otp-status code {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--forest-900);
  color: var(--lime);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.otp-status span {
  display: block;
  flex-basis: 100%;
  color: var(--muted-light);
  font-size: 7.5px;
}

.otp-status.sent {
  color: var(--forest-700);
}

.otp-status.verified {
  padding: 7px 9px;
  border-radius: 7px;
  background: #e9f4e6;
  color: #356b45;
  font-weight: 600;
}

.otp-status.error {
  color: var(--danger);
}

@media (max-width: 760px) {
  .desk-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .desk-banner .btn {
    width: 100%;
  }
  .otp-actions {
    grid-template-columns: 1fr 1fr;
  }
  .otp-actions input {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media print {
  :root { --canvas: #fff; }
  body { background: #fff; }
  .sidebar,
  .topbar,
  .mobile-overlay,
  .heading-actions,
  .report-intro .btn,
  .report-library,
  .founder-tabs,
  #toast-root,
  #modal-root {
    display: none !important;
  }
  .main-shell { margin-left: 0; }
  .content { max-width: none; padding: 0; }
  .panel,
  .stat-card,
  .report-card,
  .founder-hero {
    break-inside: avoid;
    box-shadow: none;
  }
  .report-intro { background: #0d3b2e !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .stat-card, .report-card { border: 1px solid #d8ded4; }
  .reports-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
