:root {
  --navy: #071d3b;
  --navy-2: #0b2e5f;
  --ink: #0c1730;
  --muted: #647084;
  --line: #dce4ee;
  --soft: #f4f8fb;
  --green: #08875b;
  --green-2: #10b981;
  --gold: #f6bd31;
  --red: #dc3f4a;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(7, 29, 59, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #eef5f8 0%, #ffffff 42%, #f6faf9 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(7, 29, 59, 0.94), rgba(8, 135, 91, 0.72)),
    url("assets/Logo_only.webp") right 8vw center / 360px auto no-repeat;
}

.auth-card {
  width: min(460px, 100%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: grid;
  place-items: center;
  min-height: 92px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.auth-brand img {
  width: min(310px, 100%);
  height: auto;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  min-height: 42px;
  color: var(--navy);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.auth-tabs button.active {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
}

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

.auth-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 86px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(7, 29, 59, 0.94), rgba(4, 20, 41, 0.98)),
    radial-gradient(circle at 20% 10%, rgba(16, 185, 129, 0.25), transparent 30%);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  overflow-y: auto;
  z-index: 20;
}

.brand {
  min-height: 92px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 0 18px;
}

.brand-mark {
  min-width: 0;
  flex: 1;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 250, 0.94));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.brand-logo-full {
  width: min(240px, 100%);
  height: auto;
  display: block;
}

.brand-logo-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: none;
}

.collapse-button {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}

.collapse-button:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.42);
}

.app-shell.sidebar-collapsed .collapse-button i {
  transform: rotate(180deg);
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 18px 12px;
  overflow-x: hidden;
}

.app-shell.sidebar-collapsed .brand {
  min-height: 118px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.app-shell.sidebar-collapsed .brand-mark {
  width: 60px;
  min-height: 60px;
  flex: unset;
  padding: 6px;
}

.app-shell.sidebar-collapsed .brand-logo-full {
  display: none;
}

.app-shell.sidebar-collapsed .brand-logo-icon {
  display: block;
}

.app-shell.sidebar-collapsed .collapse-button {
  width: 44px;
  height: 34px;
  transform: rotate(180deg);
}

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

.nav-button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px 1fr 16px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
}

.app-shell.sidebar-collapsed .nav-button {
  min-height: 48px;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 8px;
}

.app-shell.sidebar-collapsed .nav-button span:nth-child(2),
.app-shell.sidebar-collapsed .nav-button .chevron {
  display: none;
}

.app-shell.sidebar-collapsed .nav-icon {
  width: 34px;
  height: 34px;
}

.nav-button:hover,
.nav-button.active {
  color: var(--white);
  background: linear-gradient(90deg, var(--green), rgba(16, 185, 129, 0.72));
  border-color: rgba(255, 255, 255, 0.18);
}

.nav-submenu {
  display: grid;
  gap: 4px;
  margin: -2px 0 4px 38px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.nav-subbutton {
  min-height: 36px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}

.nav-subbutton .nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 11px;
}

.nav-subbutton:hover,
.nav-subbutton.active {
  color: var(--white);
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.25);
}

.app-shell.sidebar-collapsed .nav-submenu {
  display: none;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
}

.nav-icon i { font-size: 14px; }
.nav-subbutton .nav-icon i { font-size: 12px; }

.chevron {
  font-size: 18px;
  line-height: 1;
  opacity: 0.7;
}

.profile-panel {
  margin-top: 22px;
  width: 100%;
  padding: 12px;
  min-height: 70px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  text-align: left;
}

.profile-panel img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.profile-panel strong,
.profile-panel span {
  display: block;
}

.profile-panel strong {
  font-size: 13px;
}

.profile-panel span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.app-shell.sidebar-collapsed .profile-panel {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 10px 8px;
}

.app-shell.sidebar-collapsed .profile-panel div {
  display: none;
}

.app-shell.sidebar-collapsed .profile-panel img {
  width: 42px;
  height: 42px;
}

.main {
  min-width: 0;
  padding: 26px 30px 34px;
}

.topbar {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 18px;
}

.title-area {
  min-width: 0;
}

.header-insight {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
}

.top-actions {
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.account-menu {
  position: relative;
  flex: 0 0 auto;
}

.account-button {
  width: 224px;
  height: 58px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 8px 12px 8px 8px;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(7, 29, 59, 0.06);
  text-align: left;
  overflow: hidden;
}

.account-avatar {
  position: relative;
  width: 44px;
  height: 42px;
  display: grid;
  place-items: end center;
}

.account-avatar .env-badge {
  position: absolute;
  top: -6px;
  left: 50%;
  min-height: 18px;
  padding: 0 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(8, 135, 91, 0.12);
}

.account-button img {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px;
  max-height: 36px;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  background: var(--soft);
}

.account-button span {
  min-width: 0;
}

.account-button strong,
.account-button small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button strong {
  font-size: 13px;
  line-height: 1.1;
}

.account-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.account-dropdown button {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--navy);
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
  font-weight: 800;
}

.account-dropdown button:hover {
  background: var(--soft);
}

.env-badge {
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  color: var(--green);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  color: var(--white);
  background: linear-gradient(135deg, var(--green), var(--green-2));
  box-shadow: 0 10px 22px rgba(8, 135, 91, 0.22);
}

.secondary-button,
.icon-button {
  color: var(--navy);
  background: var(--white);
  border-color: var(--line);
}

.danger-button {
  color: var(--white);
  background: var(--red);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  place-items: center;
}

.menu-button i { font-size: 18px; color: var(--navy); }

.primary-button i,
.secondary-button i,
.danger-button i,
.icon-button i,
.row-actions button i,
.account-dropdown button i { margin-right: 7px; }

.menu-button span {
  width: 18px;
  height: 2px;
  display: block;
  margin: 3px auto;
  background: var(--navy);
}

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

.kpi-card {
  min-height: 124px;
  padding: 18px;
  color: var(--white);
  border-radius: 8px;
  background: linear-gradient(140deg, var(--navy), #082d5f);
  box-shadow: var(--shadow);
}

.kpi-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.kpi-card strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.1;
}

.kpi-card em {
  display: block;
  margin-top: 10px;
  color: #75f4bb;
  font-size: 12px;
  font-style: normal;
}

.dashboard-grid,
.crud-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.crud-layout {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(7, 29, 59, 0.08);
}

.panel-large {
  min-height: 380px;
}

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

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

.panel-header h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.chart {
  min-height: 286px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 22px 10px 0;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.bar-wrap {
  flex: 1;
  min-width: 30px;
  display: grid;
  gap: 8px;
  align-items: end;
  text-align: center;
}

.bar {
  min-height: 12px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--green-2), rgba(16, 185, 129, 0.18));
  border: 1px solid rgba(8, 135, 91, 0.2);
}

.bar-label {
  color: var(--muted);
  font-size: 12px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  width: 170px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 30%, var(--navy-2) 30% 65%, var(--gold) 65% 76%, #76a9fa 76% 100%);
  position: relative;
}

.donut::after {
  content: "Assets";
  position: absolute;
  inset: 42px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--white);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.legend {
  display: grid;
  gap: 10px;
}

.legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

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

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

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

.health-item strong {
  color: var(--navy);
  font-size: 14px;
}

.health-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.health-item em {
  color: var(--green);
  font-size: 16px;
  font-style: normal;
  font-weight: 900;
}

.health-track {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4edf3;
}

.health-track span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--green-2));
}

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

.action-card {
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.action-card strong,
.action-card span {
  display: block;
}

.action-card strong {
  margin-bottom: 8px;
}

.action-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

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

.field label {
  color: #24324a;
  font-size: 13px;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: #24324a;
  font-size: 13px;
  font-weight: 800;
}

.checkbox-field input,
.income-confirmed-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.listing-controls,
.income-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.income-filters select {
  min-height: 42px;
  padding: 8px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.income-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.income-summary span {
  flex: 1 1 150px;
  padding: 12px;
  border-radius: 8px;
  background: #f0f7f4;
  color: var(--muted);
}

.income-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 18px;
}

.income-preview article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.income-preview small { color: var(--muted); }

.debt-payment-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.debt-payment-form .field input,
.debt-payment-form .field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.debt-payment-form .payment-notes { grid-column: span 3; }
.debt-payment-balance { margin: 16px 0 10px; color: var(--muted); }
.debt-payment-balance strong { color: var(--navy); }

@media (max-width: 900px) {
  .debt-payment-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .debt-payment-form .payment-notes { grid-column: span 2; }
}

@media (max-width: 560px) {
  .debt-payment-form { grid-template-columns: 1fr; }
  .debt-payment-form .payment-notes { grid-column: auto; }
}

.field input,
.field select,
.field textarea,
.search-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

.user-summary article {
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
}

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

.user-summary span {
  color: var(--muted);
  font-size: 13px;
}

.user-summary strong {
  margin-top: 8px;
  color: var(--navy);
  font-size: 28px;
  line-height: 1;
}

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

.development-progress article {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f5fbf9);
}

.development-progress span,
.development-progress strong,
.development-progress em {
  display: block;
}

.development-progress span {
  color: var(--muted);
  font-size: 13px;
}

.development-progress strong {
  margin-top: 10px;
  color: var(--navy);
  font-size: 26px;
  line-height: 1;
}

.development-progress em {
  margin-top: 8px;
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.development-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
}

.development-layout h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 16px;
}

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

.milestone-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.milestone-card strong,
.milestone-card span {
  display: block;
}

.milestone-card strong {
  color: var(--navy);
}

.milestone-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.milestone-card em {
  min-width: 92px;
  padding: 6px 9px;
  color: var(--navy);
  background: var(--soft);
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.milestone-card em.completed {
  color: var(--green);
  background: rgba(16, 185, 129, 0.1);
}

.milestone-card em.in-progress {
  color: #8a5a00;
  background: rgba(246, 189, 49, 0.18);
}

.next-action-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.next-action-list li {
  padding: 12px 12px 12px 4px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}

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

.data-action-card {
  min-height: 190px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
}

.data-action-card span,
.data-action-card strong {
  display: block;
}

.data-action-card span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.data-action-card strong {
  margin-top: 7px;
  color: var(--navy);
  font-size: 18px;
}

.data-action-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.data-action-card select {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-action-card button {
  justify-self: start;
}

.danger-zone {
  border-color: rgba(220, 63, 74, 0.26);
  background: linear-gradient(180deg, #ffffff, #fff7f7);
}

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

.manual-card {
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
}

.manual-card span,
.manual-card strong {
  display: block;
}

.manual-card span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.manual-card strong {
  margin-top: 7px;
  color: var(--navy);
  font-size: 17px;
  line-height: 1.35;
}

.manual-card ul {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding-left: 18px;
}

.manual-card li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.faq-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.faq-item strong {
  display: block;
  color: var(--navy);
  font-size: 16px;
}

.faq-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

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

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

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

td {
  font-size: 14px;
}

.users-table {
  min-width: 940px;
}

.user-cell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.user-cell img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
}

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

.user-cell strong {
  color: var(--navy);
  font-size: 14px;
}

.user-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.record-with-note {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
}

.note-button {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--green);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 7px;
  cursor: pointer;
}

.note-button:hover,
.note-button:focus-visible,
.note-button[aria-expanded="true"] {
  color: var(--white);
  background: var(--green);
  outline-offset: 2px;
}

.notes-tooltip {
  position: fixed;
  z-index: 90;
  width: max-content;
  max-width: min(360px, calc(100vw - 24px));
  max-height: min(260px, calc(100vh - 24px));
  overflow-y: auto;
  padding: 12px 14px;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 16px 38px rgba(7, 29, 59, 0.22);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
}

.password-reset-result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.password-reset-result p { margin: 0; }
.password-reset-result code { user-select: all; font-size: 15px; }
.password-reset-result.hidden { display: none; }

.row-actions button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--white);
  font-weight: 800;
}

.row-actions button:last-child {
  color: var(--red);
}

.status-pill {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.approved {
  color: var(--green);
  background: rgba(16, 185, 129, 0.12);
}

.status-pill.pending {
  color: #9a6500;
  background: rgba(246, 189, 49, 0.18);
}

.status-pill.rejected,
.status-pill.suspended {
  color: var(--red);
  background: rgba(220, 63, 74, 0.12);
}

.role-select,
.record-status-select {
  min-width: 104px;
  min-height: 34px;
  padding: 5px 8px;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 29, 59, 0.62);
}

.modal-card {
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.record-modal-card,
.payment-modal-card {
  width: min(720px, 100%);
  max-height: min(90vh, 900px);
  overflow-y: auto;
}

.payment-modal-card {
  width: min(960px, 100%);
}

.avatar-editor {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
}

.avatar-editor img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
}

.empty-state {
  padding: 36px 12px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: 360px;
  padding: 14px 16px;
  color: var(--white);
  background: var(--navy);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

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

.hidden {
  display: none;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .dashboard-grid,
  .crud-layout {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .action-list,
  .user-summary,
  .development-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .development-layout {
    grid-template-columns: 1fr;
  }

  .data-management-grid,
  .manual-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    width: min(86vw, 300px);
    transition: transform 180ms ease;
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: min(86vw, 300px);
    padding: 18px;
  }

  .app-shell.sidebar-collapsed .brand {
    min-height: 92px;
    display: flex;
    justify-items: stretch;
  }

  .app-shell.sidebar-collapsed .brand-mark {
    width: auto;
    min-height: 70px;
    flex: 1;
    padding: 9px 12px;
  }

  .app-shell.sidebar-collapsed .brand-logo-full {
    display: block;
  }

  .app-shell.sidebar-collapsed .brand-logo-icon {
    display: none;
  }

  .app-shell.sidebar-collapsed .collapse-button {
    display: none;
  }

  .app-shell.sidebar-collapsed .nav-button {
    grid-template-columns: 28px 1fr 16px;
    justify-items: stretch;
    padding: 8px 10px;
  }

  .app-shell.sidebar-collapsed .nav-button span:nth-child(2),
  .app-shell.sidebar-collapsed .nav-button .chevron {
    display: inline;
  }

  .app-shell.sidebar-collapsed .profile-panel {
    grid-template-columns: 44px 1fr;
    justify-items: stretch;
    padding: 12px;
  }

  .app-shell.sidebar-collapsed .profile-panel div {
    display: block;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    padding: 18px;
  }

  .menu-button {
    display: block;
  }

  .collapse-button {
    display: none;
  }

  .topbar {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
  }

  .top-actions {
    grid-column: 1 / -1;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .account-button {
    width: 190px;
  }

  .header-insight {
    max-width: 100%;
  }

  .kpi-grid,
  .action-list,
  .user-summary,
  .development-progress,
  .donut-wrap {
    grid-template-columns: 1fr;
  }

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

  .milestone-card em {
    width: max-content;
  }
}

@media (max-width: 560px) {
  .topbar {
    display: grid;
    grid-template-columns: 44px 1fr;
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .top-actions > button,
  .top-actions > .env-badge {
    flex: 1;
  }

  .account-menu,
  .account-button {
    width: 100%;
  }

  .account-dropdown {
    left: 0;
    right: auto;
    width: 100%;
  }

  .panel {
    padding: 16px;
  }
}
