* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

.app {
  max-width: 1180px;
  margin: auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #111827, #1f2937);
  border: 1px solid rgba(255,255,255,.08);
  padding: 22px;
  border-radius: 22px;
  margin-bottom: 18px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 25px;
}

.topbar p {
  color: #94a3b8;
  margin-top: 6px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.card {
  background: #111827;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 16px;
}

.card span {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 8px;
}

.card strong {
  font-size: 22px;
}

.highlight {
  background: linear-gradient(135deg, #064e3b, #022c22);
}

.grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
}

.panel {
  background: #111827;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 18px;
}

.panel h2 {
  font-size: 19px;
  margin-bottom: 16px;
}

label {
  display: block;
  color: #cbd5e1;
  font-size: 13px;
  margin: 13px 0 6px;
}

input, select {
  width: 100%;
  background: #020617;
  color: white;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 13px;
  outline: none;
  font-size: 15px;
}

input:focus, select:focus {
  border-color: #38bdf8;
}

button {
  border: 0;
  border-radius: 13px;
  background: #22c55e;
  color: #052e16;
  font-weight: 800;
  padding: 13px 16px;
  cursor: pointer;
  width: 100%;
  margin-top: 16px;
}

button:hover {
  opacity: .9;
}

.ghost {
  width: auto;
  background: #334155;
  color: #fff;
  margin-top: 0;
}

.danger {
  width: auto;
  background: #ef4444;
  color: white;
  margin-top: 0;
  padding: 10px 13px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filters {
  margin-bottom: 14px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  background: #020617;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 14px;
}

.item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.income {
  background: rgba(34,197,94,.15);
  color: #86efac;
}

.expense {
  background: rgba(239,68,68,.15);
  color: #fca5a5;
}

.meta {
  color: #94a3b8;
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.5;
}

.amount {
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.delete {
  background: transparent;
  color: #f87171;
  width: auto;
  padding: 0;
  margin-top: 10px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ghost {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .app {
    padding: 12px;
  }

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

  h1 {
    font-size: 22px;
  }

  .card strong {
    font-size: 20px;
  }

  .item-top {
    flex-direction: column;
  }
}
