:root {
  --bg: #f4f7fd;
  --surface: #ffffff;
  --ink: #071a34;
  --muted: #61708a;
  --line: #dbe4ef;
  --navy: #071f40;
  --navy-2: #163f74;
  --mint: #94f1cc;
  --green: #008a66;
  --blue: #2f68f3;
  --orange: #f49a05;
  --teal: #139b92;
  --shadow: 0 1px 0 rgba(7, 31, 64, 0.04);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.sheet {
  width: min(100%, 814px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 50px 39px 116px;
}

.hero {
  position: relative;
  display: block;
  min-height: 158px;
  overflow: hidden;
  border-radius: 31px;
  background: var(--navy);
  color: #fff;
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 545px;
  padding: 36px 30px 31px 36px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 3.65vw, 31px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero p {
  margin: 8px 0 0;
  color: #c8d4e6;
  font-size: 14px;
  line-height: 1.45;
}

.hero-update {
  position: absolute;
  z-index: 1;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  width: 352px;
  min-width: 0;
  padding: 29px 35px;
  border-radius: 31px;
  background: var(--navy-2);
  text-align: right;
}

.hero-update span {
  color: var(--mint);
  font-size: 11px;
  font-weight: 900;
}

.hero-update strong {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 900;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-top: 19px;
}

.stat-card,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 101px;
  padding: 19px 18px 15px;
  border-radius: 20px;
}

.accent {
  display: block;
  width: 46px;
  height: 11px;
  margin-bottom: 10px;
  border-radius: 5px;
}

.blue {
  background: var(--blue);
}

.amber {
  background: var(--orange);
}

.teal {
  background: var(--teal);
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 1px;
  font-size: 29px;
  line-height: 1.05;
  font-weight: 950;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 241px;
  gap: 18px;
  margin-top: 32px;
}

.panel {
  border-radius: 22px;
}

.payments-panel {
  min-width: 0;
  padding: 20px 24px 13px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 21px;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 950;
}

.success-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 13px;
  border-radius: 999px;
  background: #d9f9e8;
  color: var(--green);
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.payments-table {
  width: 100%;
}

.table-head,
.payment-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 82px;
  align-items: center;
}

.table-head {
  padding-bottom: 10px;
  border-bottom: 2px solid #dce4ee;
  color: #5d6980;
  font-size: 10px;
  font-weight: 900;
}

.table-head span:last-child {
  text-align: right;
}

.payment-row {
  min-height: 57px;
  border-bottom: 1px solid #e4ebf4;
}

.empty-state {
  display: flex;
  align-items: center;
  min-height: 58px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty-state.compact {
  min-height: 43px;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 63px;
  min-height: 31px;
  border-radius: 999px;
  background: #f2f6fb;
  font-size: 10px;
  font-weight: 950;
}

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

.payment-title strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 950;
}

.payment-title small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.payment-title .updated {
  color: var(--green);
}

.amount {
  justify-self: end;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.side-stack {
  display: grid;
  gap: 21px;
  align-content: start;
}

.strong-day {
  min-height: 144px;
  padding: 18px 24px 12px;
}

.date-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 10px;
  padding: 0 11px;
  border-radius: 999px;
  background: #dbe9ff;
  color: #1e61ed;
  font-size: 10px;
  font-weight: 950;
}

.strong-day p {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.strong-day strong {
  display: block;
  margin-top: -1px;
  text-align: right;
  font-size: 31px;
  line-height: 1;
  font-weight: 950;
}

.pending-panel {
  min-height: 200px;
  padding: 18px 20px 15px;
}

.pending-panel h2 {
  margin-bottom: 13px;
}

.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 14px;
}

.pending-item + .pending-item {
  margin-top: 7px;
}

.soft-orange {
  border-color: #f3d9b8;
  background: #fff7ed;
}

.soft-blue {
  border-color: #b8d6ff;
  background: #eef6ff;
}

.pending-item strong {
  font-size: 12px;
  font-weight: 950;
}

.pending-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.pending-total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: #5e6b7e;
  font-size: 13px;
  font-weight: 900;
}

.pending-total strong {
  color: var(--ink);
  font-size: 16px;
}

.note-card {
  min-height: 149px;
  padding: 28px 25px 20px;
  border-radius: 21px;
  background: var(--navy);
  color: #d7e3f3;
}

.note-card h2 {
  margin-bottom: 14px;
  color: var(--mint);
  font-size: 13px;
}

.note-card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.85;
}

.note-card p + p {
  margin-top: 7px;
}

.sheet-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 37px;
  padding-right: 88px;
  padding-top: 13px;
  border-top: 1px solid #dbe4f0;
  color: #66758d;
  font-size: 11px;
}

.sheet-footer strong {
  color: var(--ink);
  font-weight: 950;
}

.jarvis {
  position: fixed;
  right: max(18px, calc((100vw - 814px) / 2 + 22px));
  bottom: 18px;
  z-index: 10;
}

.jarvis-toggle {
  position: relative;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: #071f40;
  box-shadow: 0 16px 34px rgba(7, 31, 64, 0.25);
  cursor: pointer;
}

.jarvis-toggle::before {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(148, 241, 204, 0.75);
  border-radius: inherit;
  animation: pulse-ring 2.6s ease-in-out infinite;
}

.jarvis-core,
.jarvis-mark {
  display: inline-block;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 9%, transparent 10%),
    radial-gradient(circle at 50% 50%, #94f1cc 0 28%, #2f68f3 29% 49%, transparent 50%),
    conic-gradient(from 110deg, #94f1cc, #2f68f3, #13a69d, #94f1cc);
}

.jarvis-core {
  width: 33px;
  height: 33px;
}

.jarvis-panel {
  position: absolute;
  right: 0;
  bottom: 73px;
  display: flex;
  flex-direction: column;
  width: min(345px, calc(100vw - 28px));
  max-height: min(600px, calc(100vh - 105px));
  overflow: hidden;
  border: 1px solid rgba(148, 241, 204, 0.45);
  border-radius: 22px;
  background: #071f40;
  box-shadow: 0 24px 54px rgba(7, 31, 64, 0.28);
  color: #fff;
}

.jarvis-panel[hidden] {
  display: none;
}

.jarvis-panel header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 15px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.jarvis-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.jarvis-panel h2 {
  color: #fff;
  font-size: 15px;
}

.jarvis-panel p {
  margin: 2px 0 0;
  color: #aab9ce;
  font-size: 11px;
}

.jarvis-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #dce8f8;
  cursor: pointer;
}

.messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 185px;
  overflow-y: auto;
  padding: 14px;
}

.message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.42;
}

.message.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.09);
  color: #e8f2ff;
}

.message.user {
  align-self: flex-end;
  background: #d9f9e8;
  color: #073522;
}

.quick-actions {
  display: flex;
  gap: 7px;
  padding: 0 14px 12px;
}

.quick-actions button {
  flex: 1;
  min-height: 31px;
  border: 1px solid rgba(148, 241, 204, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cfe5ff;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.jarvis-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.jarvis-form input {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0 14px;
  outline: none;
}

.jarvis-form input::placeholder {
  color: #91a1b8;
}

.jarvis-form button {
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #94f1cc;
  color: #063425;
  padding: 0 15px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@keyframes pulse-ring {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.08);
  }
}

@media (max-width: 720px) {
  .sheet {
    padding: 18px 14px 104px;
  }

  .hero {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 24px;
  }

  .hero-copy {
    max-width: none;
    padding: 28px 22px 18px;
  }

  .hero h1 {
    white-space: normal;
    font-size: clamp(28px, 9.2vw, 35px);
  }

  .hero-update {
    position: static;
    align-items: flex-start;
    width: auto;
    min-height: 96px;
    padding: 20px 22px;
    border-radius: 24px 24px 0 0;
    text-align: left;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
  }

  .stat-card {
    min-height: 92px;
    border-radius: 18px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 18px;
  }

  .payments-panel {
    padding: 20px 16px 12px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }

  .table-head,
  .payment-row {
    grid-template-columns: 70px minmax(0, 1fr) 68px;
  }

  .table-head {
    font-size: 10px;
  }

  .date-pill {
    width: 58px;
  }

  .payment-row {
    min-height: 62px;
  }

  .payment-title strong {
    font-size: 12px;
  }

  .amount {
    font-size: 12px;
  }

  .side-stack {
    gap: 14px;
  }

  .strong-day strong {
    text-align: left;
  }

  .sheet-footer {
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
    padding-right: 0;
  }

  .jarvis {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 360px) {
  .sheet {
    padding-inline: 10px;
  }

  .hero-copy,
  .hero-update {
    padding-inline: 18px;
  }

  .payments-panel,
  .strong-day,
  .pending-panel,
  .note-card {
    padding-inline: 14px;
  }

  .table-head,
  .payment-row {
    grid-template-columns: 62px minmax(0, 1fr) 64px;
  }

  .date-pill {
    width: 54px;
    font-size: 9px;
  }

  h2 {
    font-size: 20px;
  }
}

@media print {
  .sheet {
    padding-bottom: 50px;
  }

  .jarvis {
    display: none;
  }
}
