:root {
  --bg: #eaf2ef;
  --bg-strong: #d6e8e2;
  --panel: #fdfefc;
  --ink: #10231d;
  --muted: #4d6058;
  --accent: #0f8b70;
  --accent-deep: #0a6a54;
  --accent-warm: #d66f22;
  --line: #d6dfdb;
  --danger: #b53f4e;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 18px 45px rgba(16, 35, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: linear-gradient(145deg, var(--bg), var(--bg-strong));
}

.hidden {
  display: none !important;
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(470px, 100%);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.auth-brand {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.auth-brand h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
}

.auth-brand p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.auth-tabs {
  margin-top: 1rem;
  border: 1px solid #d7e5df;
  background: #eef5f2;
  border-radius: 12px;
  padding: 0.2rem;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-tab {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.5rem;
  cursor: pointer;
  font-weight: 700;
  color: #2a4c44;
}

.auth-tab.is-active {
  background: linear-gradient(120deg, #d8ece5, #f5ede4);
}

.auth-form {
  margin-top: 0.9rem;
}

.auth-message {
  min-height: 1.2rem;
  margin: 0.7rem 0 0;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.83rem;
}

.forgot-link {
  margin: 0;
  text-align: center;
  font-size: 0.83rem;
}

.forgot-link a {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 600;
}

.forgot-link a:hover {
  text-decoration: underline;
}

.zoho-sso-btn {
  background: linear-gradient(120deg, #e8822a, #f0a05e);
  color: white;
  border-color: transparent;
}

.zoho-sso-btn:hover {
  filter: brightness(0.96);
}

.orb {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(16px);
  z-index: 0;
  opacity: 0.35;
}

.orb-left {
  left: -140px;
  top: -80px;
  background: radial-gradient(circle at center, #b8ddd2, transparent 75%);
}

.orb-right {
  right: -100px;
  bottom: -100px;
  background: radial-gradient(circle at center, #f2cfb4, transparent 75%);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 1rem;
  max-width: 1280px;
  margin: 1.2rem auto;
  padding: 0 1rem;
}

.sidebar {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 2.4rem);
}

.brand-wrap {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(130deg, var(--accent), #7acbb8);
  color: white;
  font-weight: 700;
}

.brand-wrap h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
}

.brand-wrap p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.nav-list {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-btn {
  border: 0;
  border-radius: 12px;
  text-align: left;
  padding: 0.7rem 0.8rem;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-btn:hover {
  background: #e8f3ef;
  transform: translateX(2px);
}

.nav-btn.is-active {
  background: linear-gradient(120deg, #d8ece5, #f5ede4);
  color: var(--accent-deep);
}

.nav-btn span {
  font-size: 0.75rem;
  color: var(--muted);
}

.side-footer {
  margin-top: auto;
  background: #f6faf8;
  border: 1px dashed #c7d7d1;
  border-radius: var(--radius-md);
  padding: 0.8rem;
}

.side-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.side-footer a {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 700;
}

.main-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.topbar h2 {
  margin: 0.2rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.6rem;
}

.health-pill {
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: #def4ed;
  border: 1px solid #b8e6d9;
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.83rem;
}

.dashboard-layout {
  display: grid;
  gap: 0.8rem;
}

.dashboard-top-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.8rem;
}

.dashboard-welcome h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.7rem;
}

.dashboard-quick-links h3 {
  margin-bottom: 0.7rem;
}

.quick-link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.quick-link-btn {
  border: 1px solid #d6e4df;
  background: #f7faf9;
  border-radius: 10px;
  padding: 0.7rem 0.6rem;
  font-weight: 700;
  color: #24463e;
  cursor: pointer;
}

.quick-link-btn:hover {
  background: #edf6f2;
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: minmax(240px, 300px);
  gap: 0.8rem;
}

.dashboard-stat-card {
  text-align: center;
}

.dashboard-stat-card p {
  margin: 0.4rem 0 0;
  font-size: 2rem;
  font-weight: 700;
}

.dashboard-section-card h3 {
  margin-bottom: 0.7rem;
}

.dashboard-alert {
  border-radius: 10px;
  padding: 0.75rem;
}

.dashboard-alert p {
  margin: 0;
  font-weight: 600;
}

.dashboard-alert.success {
  background: #e8f7f1;
  border: 1px solid #bee4d7;
  color: #1f5d4d;
}

.dashboard-alert.warning {
  background: #fff4e8;
  border: 1px solid #f3d5b3;
  color: #84501d;
}

.dashboard-alert.info {
  background: #e9f1fb;
  border: 1px solid #c8dff8;
  color: #1d4f84;
}

.dashboard-todo-summary {
  border: 1px solid #d4dcda;
  border-radius: 10px;
  overflow: hidden;
}

.dashboard-todo-row {
  background: #f3f4f5;
  border-top: 1px solid #e4e8e7;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem;
}

.dashboard-todo-row p {
  margin: 0;
  color: #23302c;
  font-weight: 600;
}

.dashboard-plus {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: white;
  background: #545a5d;
}

.dashboard-count-badge {
  border: 1px solid #ea8b84;
  background: #fff;
  color: #d04a42;
  border-radius: 8px;
  padding: 0 0.35rem;
  font-weight: 700;
}

.view-all-todos {
  margin-left: auto;
  white-space: nowrap;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.admin-metric-card p {
  margin: 0.45rem 0 0;
  font-size: 1.9rem;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric-card,
.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.metric-card h3,
.panel-card h3,
.section-title {
  margin: 0;
  font-size: 0.95rem;
}

.metric-card p {
  margin: 0.5rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.split-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0.8rem;
}

.timeline {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.timeline li {
  border-left: 3px solid #cce6de;
  padding: 0.35rem 0.6rem;
  background: #fbfdfc;
}

.timeline strong {
  display: block;
  font-size: 0.92rem;
}

.stack {
  display: grid;
  gap: 0.7rem;
}

.loan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  background: #fdfffd;
}

.loan-selected {
  border-color: #94cabd;
  box-shadow: inset 0 0 0 1px #cde8e0;
}

.loan-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.chip {
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  font-size: 0.74rem;
  font-weight: 700;
}

.chip.good {
  background: #def4ed;
  color: var(--accent-deep);
}

.chip.warn {
  background: #fae9d9;
  color: #8a4f1f;
}

.chip.bad {
  background: #f9dfe3;
  color: var(--danger);
}

.chip.neutral {
  background: #edf2f0;
  color: #3f504a;
}

.chip.status-required {
  background: #fff1da;
  color: #92510f;
}

.chip.status-in-progress {
  background: #e4f0ff;
  color: #1f5296;
}

.chip.status-in-review {
  background: #efe8ff;
  color: #5b3f95;
}

.chip.status-additional-info-needed {
  background: #ffe6db;
  color: #9a3f14;
}

.chip.status-approved {
  background: #dff6e9;
  color: #0b6f43;
}

.chip.status-rejected {
  background: #fce2e8;
  color: #ab1f47;
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e4ece9;
  overflow: hidden;
  margin: 0.6rem 0;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #8bcdbd);
}

.loan-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  font-size: 0.84rem;
}

.loan-metrics div {
  background: #f6faf7;
  border: 1px solid #dfebe5;
  border-radius: 10px;
  padding: 0.45rem;
}

.loan-stage-panel {
  margin-top: 0.85rem;
  border: 1px solid #dce7e2;
  border-radius: 12px;
  background: #f8fcfa;
  padding: 0.8rem;
}

.loan-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.loan-stage-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.loan-stage-track {
  position: relative;
  margin-top: 0.65rem;
  padding-top: 0.1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.1rem;
}

.loan-stage-track::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 12px;
  border-top: 2px solid #cfded8;
}

.loan-stage-step {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  text-align: center;
}

.loan-stage-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin: 0 auto;
  display: block;
  border: 2px solid #9fb3ab;
  background: #fff;
}

.loan-stage-label {
  margin-top: 0.35rem;
  display: block;
  font-size: 0.68rem;
  color: #445752;
  font-weight: 600;
  line-height: 1.2;
}

.loan-stage-step.completed .loan-stage-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.loan-stage-step.current .loan-stage-dot {
  background: #fff;
  border-color: var(--accent-warm);
  box-shadow: 0 0 0 4px rgba(214, 111, 34, 0.16);
}

.loan-stage-step.current .loan-stage-label {
  color: #1b302b;
}

.loan-stage-step.upcoming .loan-stage-dot {
  background: #f4f8f6;
}

.loan-summary-sections {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.loan-summary-section {
  border: 1px solid #dce7e2;
  border-radius: 12px;
  background: #fbfdfc;
  overflow: hidden;
}

.loan-summary-section h4 {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #deebe6;
  background: #f4f8f6;
  font-size: 0.95rem;
}

.loan-summary-table td {
  padding: 0.45rem 0.65rem;
  font-size: 0.84rem;
}

.loan-summary-table td:first-child {
  color: #395148;
  width: 54%;
}

.loan-summary-table td:last-child {
  text-align: right;
  font-weight: 700;
  color: #1a2f2a;
}

@media (max-width: 1080px) {
  .loan-summary-sections {
    grid-template-columns: 1fr;
  }
}

.loan-actions {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
}

.loan-detail-wrap {
  display: grid;
  gap: 0.8rem;
}

.loan-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.text-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: #2a4c44;
  font-weight: 700;
  cursor: pointer;
}

.open-upload-task strong {
  color: #0a6a54;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.loan-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.55rem;
}

.loan-subtabs {
  border: 1px solid #d7e5df;
  background: #f4f7f6;
  border-radius: 12px;
  padding: 0.25rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.loan-tab {
  border: 0;
  border-radius: 9px;
  padding: 0.5rem 0.8rem;
  background: transparent;
  color: #446058;
  font-weight: 700;
  cursor: pointer;
}

.loan-tab.is-active {
  background: #fff;
  color: #132723;
  border: 1px solid #d7e3df;
}

.todo-box {
  border: 1px solid #cad6d2;
  border-radius: 12px;
  padding: 0.85rem;
  background: #fdfefd;
}

.todo-box h3 {
  margin: 0 0 0.65rem;
}

.todo-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.todo-empty {
  border: 1px solid #bfe4d7;
  background: #e8f7f1;
  border-radius: 10px;
  padding: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.todo-empty p {
  margin: 0;
  color: #1f5d4d;
  font-weight: 600;
}

.todo-subsections {
  display: grid;
  gap: 0.75rem;
}

.todo-subsection {
  border: 1px solid #d8e2de;
  border-radius: 10px;
  padding: 0.65rem;
  background: #ffffff;
}

.todo-subsection h4 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.task-list {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.6rem;
}

.task-item {
  border: 1px solid #dde8e4;
  background: #fcfefd;
  border-radius: 12px;
  padding: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.task-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.loan-task-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  background: #fdfffd;
}

.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 11px;
  padding: 0.62rem 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.danger-btn {
  background: #fbe8eb;
  color: #8d2737;
}

.account-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.account-actions-cell {
  min-width: 210px;
}

.zoho-contact-cell {
  min-width: 220px;
  display: grid;
  gap: 0.35rem;
}

.zoho-contact-cell code {
  width: fit-content;
  background: #f1f6f3;
  border: 1px solid #d9e5df;
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
  font-size: 0.78rem;
}

.primary-btn {
  background: linear-gradient(120deg, var(--accent), #75c7b4);
  color: white;
}

.ghost-btn {
  background: #ecf2ef;
  color: #25403b;
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.55rem;
}

th,
td {
  text-align: left;
  padding: 0.62rem;
  border-bottom: 1px solid #e3ebe8;
  font-size: 0.86rem;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.support-feed {
  border: 1px solid var(--line);
  background: #fcfefd;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: grid;
  gap: 0.65rem;
  max-height: 300px;
  overflow-y: auto;
}

.msg {
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  max-width: 80%;
}

.msg.borrower {
  margin-left: auto;
  background: #dcf1ea;
}

.msg.servicer {
  background: #eef2f0;
}

.msg small {
  display: block;
  color: var(--muted);
  margin-top: 0.3rem;
}

form {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.65rem;
}

label {
  display: grid;
  gap: 0.26rem;
  font-weight: 600;
  font-size: 0.84rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cedcd6;
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 4.35rem;
}

.password-toggle {
  border: 0;
  background: transparent;
  color: #2a4c44;
  font-weight: 700;
  cursor: pointer;
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
}

textarea {
  min-height: 95px;
  resize: vertical;
}

.row {
  display: flex;
  gap: 0.65rem;
}

.row > * {
  flex: 1;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 23, 20, 0.52);
  z-index: 20;
  padding: 0.8rem;
}

.modal.is-open {
  display: flex;
  animation: fade-in 0.2s ease;
}

.modal-card {
  width: min(470px, 100%);
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid #d7e3de;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.form-modal-card {
  width: min(1180px, 96vw);
  height: min(860px, 92vh);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.65rem;
}

.form-modal-body {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 0.7rem;
}

.form-modal-main {
  min-height: 0;
  height: 100%;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.5rem;
}

.form-modal-main iframe {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 1px solid #dbe7e2;
  border-radius: 12px;
  background: #fff;
}

.form-modal-main.is-disabled iframe {
  opacity: 0.55;
  filter: grayscale(0.2);
}

.form-disabled-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: calc(0.5rem + 40px);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(219, 231, 226, 0.95);
  color: #1f5a4e;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1rem;
  pointer-events: auto;
}

.form-disabled-note {
  margin: 0;
  padding: 0.55rem 0.6rem;
  border: 1px solid #ecd5b7;
  border-radius: 10px;
  background: #fff7ec;
  color: #7b4d16;
  font-size: 0.82rem;
  font-weight: 700;
}

.form-modal-comments {
  margin-top: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.form-modal-comments .task-comments-list {
  max-height: none;
}

@media (max-width: 1100px) {
  .form-modal-card {
    width: min(1180px, 98vw);
    height: min(860px, 95vh);
  }

  .form-modal-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 1fr) auto;
  }

  .form-modal-main iframe {
    min-height: 420px;
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.modal-head h3 {
  margin: 0;
}

.task-modal-section {
  margin-top: 0.7rem;
}

.task-modal-section h4 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.task-comments-list {
  border: 1px solid #dbe5e1;
  border-radius: 10px;
  background: #fcfefd;
  padding: 0.55rem;
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  gap: 0.45rem;
}

.task-comment {
  border: 1px solid #e2ece8;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: #fff;
}

.task-comment-head {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  max-width: min(92vw, 780px);
  background: #10231d;
  color: white;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  white-space: normal;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-top-grid,
  .dashboard-bottom-grid,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .metric-grid,
  .dashboard-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 680px) {
  .metric-grid,
  .dashboard-stat-grid {
    grid-template-columns: 1fr;
  }

  .loan-metrics,
  .row,
  .actions {
    display: grid;
  }

  .actions {
    justify-content: stretch;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .loan-subtabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .task-item,
  .loan-actions,
  .task-actions,
  .dashboard-todo-row {
    flex-direction: column;
    align-items: stretch;
  }

  .view-all-todos {
    margin-left: 0;
  }
}
