:root {
  color-scheme: dark;
}

body,
html {
  min-height: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.2), transparent 45%),
    radial-gradient(circle at top right, rgba(125, 211, 252, 0.18), transparent 55%),
    linear-gradient(180deg, #020617 0%, #0f172a 100%);
  color: #e2e8f0;
}

.financial-scroll-lock {
  overflow: hidden;
}

.finance-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.finance-skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  box-shadow: 0 12px 30px rgba(8, 47, 73, 0.3);
}

.finance-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  position: relative;
}

.finance-shell::before {
  content: '';
  position: absolute;
  inset: 2rem 0 0;
  border-radius: 3rem;
  background: radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.18), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(96, 165, 250, 0.16), transparent 40%);
  opacity: 0.55;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}

.finance-shell > * {
  position: relative;
  z-index: 1;
}

.finance-hero {
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 2.5rem;
  padding: 3rem clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 30px 60px rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.finance-hero__eyebrow {
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #38bdf8;
}

.finance-hero__title {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  color: #f8fafc;
}

.finance-hero__lead {
  margin: 0;
  max-width: 48ch;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(226, 232, 240, 0.85);
}

.finance-layout {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.finance-card {
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 2rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  box-shadow: 0 25px 45px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(16px);
}

.finance-card--metrics {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.finance-card__title {
  margin: 0;
  font-size: 1.5rem;
  color: #f8fafc;
}

.finance-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.finance-card__subhead {
  margin: 0;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}

.finance-summary__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 0;
}

.finance-summary__stat {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 1.5rem;
  padding: 1.25rem 1.5rem;
  display: grid;
  gap: 0.35rem;
}

.finance-summary__stat dt {
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.8);
}

.finance-summary__stat dd {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: #f8fafc;
}

.finance-card--form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.finance-form {
  display: grid;
  gap: 1.25rem;
}

.finance-form__grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.finance-field {
  display: grid;
  gap: 0.5rem;
}

.finance-field__label {
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.85);
}

.finance-field input,
.finance-field textarea {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 252, 0.95);
  color: #0f172a;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.finance-field textarea {
  resize: vertical;
  min-height: 6.5rem;
}

.finance-field input:focus,
.finance-field textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.finance-button {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: #0b1220;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.finance-button:hover,
.finance-button:focus {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(14, 165, 233, 0.35);
  outline: none;
}

.finance-card--ledger {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.finance-ledger {
  display: grid;
  gap: 1.25rem;
}

.finance-payables {
  gap: 1.5rem;
}

.finance-ledger__empty {
  margin: 0;
  padding: 1.75rem;
  border-radius: 1.5rem;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  text-align: center;
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.75);
}

.finance-entry {
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.85);
  padding: 1.5rem;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.45);
  display: grid;
  gap: 0.75rem;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.finance-payable {
  position: relative;
  overflow: hidden;
}

.finance-payable::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(14, 165, 233, 0.05));
}

.finance-payable:hover::before,
.finance-payable:focus-within::before {
  opacity: 1;
}

.finance-payable--settled {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.25);
  opacity: 0.8;
}

.finance-payable--settled .finance-entry__amount {
  color: rgba(148, 163, 184, 0.85);
}

.finance-payable__actions {
  display: flex;
  justify-content: flex-end;
}

.finance-button--secondary {
  background: rgba(15, 23, 42, 0.85);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.6);
  box-shadow: none;
}

.finance-button--secondary:hover,
.finance-button--secondary:focus {
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.25);
}

.finance-entry:hover,
.finance-entry:focus-within {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.6);
}

.finance-entry__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.finance-entry__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f8fafc;
}

.finance-entry__amount {
  font-size: 1.05rem;
  font-weight: 600;
  color: #38bdf8;
}

.finance-entry__meta {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.75);
}

.finance-entry__notes {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(226, 232, 240, 0.9);
}

.eth-panel {
  display: grid;
  gap: 1rem;
}

.eth-status {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: rgba(226, 232, 240, 0.95);
}

.eth-status--error {
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecdd3;
}

.eth-status--success {
  border-color: rgba(74, 222, 128, 0.65);
  color: #bbf7d0;
}

.eth-connection {
  display: grid;
  gap: 0.75rem;
}

.eth-connection__details {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

.eth-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
}

.eth-value {
  display: block;
  margin-top: 0.35rem;
  font-weight: 600;
  color: #f8fafc;
  word-break: break-all;
}

.eth-message {
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.95rem;
  color: #f8fafc;
}

.eth-log__header {
  display: grid;
  gap: 0.35rem;
}

.eth-log__title {
  margin: 0;
  font-size: 1rem;
  color: #f8fafc;
}

.eth-log__hint {
  margin: 0;
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.9rem;
}

.eth-log {
  display: grid;
  gap: 0.75rem;
}

.eth-log__item {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.75);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.45);
}

.eth-log__meta {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.9);
}

.eth-log__hash {
  margin: 0;
  font-size: 0.9rem;
  word-break: break-all;
  color: #38bdf8;
}

@media (max-width: 640px) {
  .finance-shell {
    padding-top: 3.75rem;
  }

  .finance-card__header {
    align-items: stretch;
  }
}
