body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.15), transparent 26%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.10), transparent 22%),
    linear-gradient(180deg, #f6f7fb 0%, #eef2f7 100%);
}

.app-shell {
  position: relative;
}

.app-sidebar {
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.97) 0%, rgba(15, 23, 42, 0.95) 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.app-brand {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.app-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: #facc15;
}

.app-brand-mark::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.25), rgba(250, 204, 21, 0.9));
}

.app-brand-title {
  margin-top: 0.9rem;
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.app-nav-link {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.95rem;
  color: #cbd5e1;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.app-nav-link:hover {
  color: #ffffff;
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.15);
  transform: translateX(1px);
}

.app-main {
  position: relative;
}

.nav-link {
  display: block;
  border-radius: 0.9rem;
  padding: 0.8rem 1rem;
  color: #334155;
  font-weight: 500;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-link.is-active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.page-eyebrow {
  margin: 0 0 0.65rem 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #64748b;
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 680;
  color: #0f172a;
}

.page-subtitle {
  margin: 0.75rem 0 0 0;
  max-width: 52rem;
  color: #475569;
  line-height: 1.6;
}

.surface-panel,
.data-panel,
.stat-card,
.hero-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(18px);
}

.hero-panel {
  border-radius: 1.6rem;
  padding: 1.5rem;
}

.data-panel {
  border-radius: 1.45rem;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.stat-card {
  border-radius: 1.3rem;
  padding: 1rem;
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.stat-value {
  margin-top: 0.85rem;
  font-size: 2rem;
  font-weight: 670;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.stat-meta {
  margin-top: 0.55rem;
  font-size: 0.9rem;
  color: #64748b;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-badge::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 9999px;
  background: currentColor;
}

.status-badge-active {
  background: #dcfce7;
  color: #047857;
}

.status-badge-archived {
  background: #fef3c7;
  color: #b45309;
}

.toolbar,
.action-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.toggle-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.65rem 1rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 650;
  color: #475569;
}

.toggle-pill.is-active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.16);
}

.table-shell table thead {
  background: rgba(248, 250, 252, 0.95);
}

.table-shell table th {
  font-size: 0.77rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.table-shell table td,
.table-shell table th {
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
}

.table-shell table tbody tr:hover {
  background: rgba(248, 250, 252, 0.85);
}

.button-link,
.primary-button,
.secondary-button,
.outline-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 9999px;
  padding: 0.8rem 1.15rem;
  font-weight: 650;
  line-height: 1.1;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.form-shell {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.6rem;
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.09);
  backdrop-filter: blur(20px);
}

.form-section {
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 1.15rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 1.3rem;
}

.form-section-title {
  margin: 0 0 1rem 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #475569;
}

.primary-button {
  border: 1px solid #0f172a;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.secondary-button {
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.outline-button {
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.72);
  color: #0f172a;
}

.danger-button {
  border: 1px solid rgba(217, 119, 6, 0.32);
  background: rgba(255, 251, 235, 0.96);
  color: #b45309;
}

.button-link:hover,
.primary-button:hover,
.secondary-button:hover,
.outline-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.action-row {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

form p,
form .field-group {
  margin: 0 0 1rem 0;
}

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: #64748b;
}

.clients-hero {
  padding: 1.5rem;
  border-radius: 1.5rem;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.94) 55%, rgba(51, 65, 85, 0.92) 100%);
  color: #f8fafc;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
}

.clients-hero .page-eyebrow,
.clients-hero .page-subtitle {
  color: rgba(226, 232, 240, 0.78);
}

.clients-hero .page-title {
  color: #ffffff;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.hero-stat {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stat-label {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(226, 232, 240, 0.7);
}

.hero-stat-value {
  margin-top: 0.55rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.hero-stat-meta {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.72);
}

.dashboard-kpi-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}

.supporting-kpi-card {
  min-width: 0;
  padding: 1.25rem;
  border-radius: 1.3rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(18px);
}

.supporting-kpi-value {
  margin-top: 0.55rem;
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 670;
  letter-spacing: -0.03em;
  color: #0f172a;
  word-break: break-word;
}

.supporting-kpi-card.is-expense .supporting-kpi-value {
  color: #b45309;
}

.supporting-kpi-card.is-positive .supporting-kpi-value {
  color: #047857;
}

.supporting-kpi-card.is-negative .supporting-kpi-value {
  color: #b91c1c;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  padding: 0.8rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 650;
  color: #475569;
}

.filter-chip.is-active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.18);
}

.list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.list-card-main {
  min-width: 0;
}

.list-card-title {
  font-size: 1rem;
  font-weight: 650;
  color: #0f172a;
}

.list-card-meta {
  margin-top: 0.3rem;
  font-size: 0.88rem;
  color: #64748b;
}

.list-card-side {
  text-align: right;
  white-space: nowrap;
}

.text-link-action {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
}

.text-link-action:hover {
  text-decoration: underline;
}

.form-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.75rem;
  border-radius: 9999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #475569;
}

.form-kicker::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #0f172a;
}

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

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

.field-span-full {
  grid-column: 1 / -1;
}

.field-card {
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 1rem;
}

.field-card > label {
  margin-bottom: 0.45rem;
}

.section-copy {
  margin-top: 0.2rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.55;
}

.form-shell-flat {
  padding: 2rem;
}

@media (min-width: 768px) {
  .form-layout {
    grid-template-columns: 0.95fr 1.05fr;
  }

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

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

@media (min-width: 900px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.login-shell {
  position: relative;
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: -1.25rem;
  border-radius: 2rem;
  background: radial-gradient(circle at top, rgba(251, 191, 36, 0.22), transparent 35%);
  z-index: -1;
}

form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
}

form input:not([type="checkbox"]):not([type="radio"]),
form select,
form textarea {
  width: 100%;
  border: 2px solid #334155 !important;
  background: #ffffff !important;
  color: #0f172a;
  border-radius: 0.75rem;
  padding: 0.8rem 0.95rem;
  line-height: 1.4;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

form textarea {
  min-height: 8rem;
  resize: vertical;
}

form input::placeholder,
form textarea::placeholder {
  color: #94a3b8;
}

form input:not([type="checkbox"]):not([type="radio"]):focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: #0f172a !important;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.12);
  background: #ffffff;
}

form input[type="checkbox"],
form input[type="radio"] {
  width: 1rem;
  height: 1rem;
  accent-color: #0f172a;
  outline: 2px solid #334155;
  outline-offset: 2px;
}

form .helptext,
form .helptext ul,
form .help-text {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #64748b;
}

form ul.errorlist {
  list-style: none;
  margin: 0.45rem 0 0 0;
  padding: 0;
  font-size: 0.82rem;
  color: #b91c1c;
}

form ul.errorlist li {
  margin: 0.15rem 0;
}

form .errorlist.nonfield,
form .nonfield {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

form p:has(input[type="checkbox"]),
form p:has(input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

form p:has(input[type="checkbox"]) label,
form p:has(input[type="radio"]) label {
  margin-bottom: 0;
}

@media (max-width: 1023px) {
  .page-header {
    flex-direction: column;
  }
}

.primary-button.w-full,
.secondary-button.w-full {
  width: 100%;
}


.mobile-nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 0.55rem 0.9rem;
  color: #334155;
  background: #ffffff;
  font-weight: 500;
}

.mobile-nav-pill.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}
