:root {
  --background: #f3f6f9;
  --foreground: #101828;
  --card: rgba(255, 255, 255, 0.86);
  --muted: #667085;
  --line: rgba(16, 24, 40, 0.1);
  --primary: #0a7c86;
  --primary-strong: #075d66;
  --success: #138a42;
  --danger: #c43d4b;
  --warning: #bd691d;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(10, 124, 134, 0.16), transparent 28rem),
    linear-gradient(180deg, #fbfcfd 0%, var(--background) 40%);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(430px, 100%);
  text-align: center;
}

.brand {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 22px;
  background: var(--primary);
  color: white;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(10, 124, 134, 0.28);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 4px;
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 900;
}

h2 {
  margin-bottom: 12px;
  font-size: 26px;
  font-weight: 900;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

.small {
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 700;
}

.panel,
.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--foreground);
  padding: 0 16px;
  outline: none;
}

input:focus,
select:focus {
  border-color: color-mix(in srgb, var(--primary) 55%, white);
  box-shadow: 0 0 0 3px rgba(10, 124, 134, 0.16);
}

.primary,
.danger,
.secondary {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 900;
}

.primary {
  background: var(--primary);
  color: white;
}

.primary:hover {
  background: var(--primary-strong);
}

.danger {
  background: rgba(196, 61, 75, 0.12);
  color: var(--danger);
}

.secondary,
.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--foreground);
}

.error {
  margin: 0;
  border-radius: 12px;
  background: rgba(196, 61, 75, 0.12);
  color: var(--danger);
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
}

.app {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 16px 92px;
}

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

.topbar h1 {
  font-size: 24px;
}

.icon-btn {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 900;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 0 -16px 18px;
  overflow-x: auto;
  padding: 0 16px 4px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  min-height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  padding: 0 15px;
  font-size: 14px;
  font-weight: 900;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.stack {
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.hero {
  border-radius: 28px;
  background: var(--primary);
  color: white;
  padding: 22px;
  box-shadow: 0 22px 56px rgba(10, 124, 134, 0.28);
}

.hero .value {
  margin: 8px 0 18px;
  font-size: clamp(32px, 8vw, 48px);
  font-weight: 900;
}

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

.glass-metric {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  padding: 13px;
}

.glass-metric p {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
}

.glass-metric strong,
.mini strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
}

.mini-row {
  display: flex;
  gap: 10px;
  margin: 0 -16px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
}

.mini-row::-webkit-scrollbar {
  display: none;
}

.mini {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  padding: 13px;
}

.mini p,
.card-sub {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.card {
  padding: 16px;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.dot {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(10, 124, 134, 0.12);
}

.grow {
  min-width: 0;
  flex: 1;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount {
  font-weight: 900;
  text-align: right;
}

.income {
  color: var(--success);
}

.expense {
  color: var(--danger);
}

.searchbar {
  display: flex;
  gap: 8px;
}

.searchbar input {
  flex: 1;
}

.progress {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.08);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.card-face {
  border-radius: 28px;
  color: white;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.card-face .number {
  margin-top: 40px;
  font-weight: 900;
}

.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 34px;
  font-weight: 500;
  box-shadow: 0 16px 38px rgba(10, 124, 134, 0.36);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(8px);
}

.sheet {
  width: min(520px, 100%);
  max-height: 94vh;
  margin: 0 auto;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px;
  box-shadow: 0 -20px 60px rgba(15, 23, 42, 0.22);
}

.handle {
  width: 46px;
  height: 6px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.32);
}

.sheet-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.sheet label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.amount-preview {
  margin: 7px 0 0;
  color: var(--primary);
  text-align: center;
  font-size: 20px;
  font-weight: 900;
}

.segmented,
.choice-grid {
  display: grid;
  gap: 8px;
}

.segmented {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.08);
  padding: 4px;
}

.segmented button,
.choice-grid button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 900;
}

.segmented button.active,
.choice-grid button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

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

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

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 10px;
  margin-top: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 40;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
  border-radius: 16px;
  background: var(--foreground);
  color: white;
  padding: 13px 16px;
  text-align: center;
  font-weight: 800;
  box-shadow: var(--shadow);
}

@media (min-width: 760px) {
  .app {
    padding-top: 28px;
  }

  .grid.desktop-two {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .modal {
    align-items: center;
    padding: 24px;
  }

  .sheet {
    border-radius: 28px;
  }
}

@media (max-width: 480px) {
  .payment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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