* {
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 82px;
}

header {
  height: 64px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
}

header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 14px 26px;
}

.hero {
  text-align: center;
  padding: 8px 0 18px;
}

.hero h2 {
  margin: 0 0 5px;
  font-size: 22px;
  font-weight: 750;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.06);
}

label {
  display: block;
  margin: 0 0 7px;
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 48px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  padding: 0 13px;
  font-size: 16px;
  background: white;
  color: var(--text);
  margin-bottom: 16px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

button {
  border: 0;
  border-radius: 11px;
  min-height: 46px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
  cursor: default;
}

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

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

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

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

.secondary {
  background: #e2e8f0;
  color: #334155;
}

.notice {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #475569;
  border-radius: 12px;
  padding: 13px;
  text-align: center;
  font-size: 14px;
}

.entry-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.entry-top strong {
  font-size: 17px;
}

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

.muted {
  color: var(--muted);
  font-size: 14px;
}

.paid {
  color: #059669;
  font-weight: 700;
}

.unpaid {
  color: #dc2626;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.summary .card {
  padding: 14px 8px;
  text-align: center;
  margin-bottom: 0;
}

.summary strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.empty {
  text-align: center;
  padding: 42px 16px;
  color: var(--muted);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 30;
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.05);
}

.bottom-nav a {
  flex: 1;
  text-decoration: none;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
}

.bottom-nav a.active {
  color: var(--primary);
}

.icon {
  font-size: 23px;
  line-height: 1;
}

@media (max-width: 520px) {
  main {
    padding-left: 12px;
    padding-right: 12px;
  }

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

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

  .card {
    border-radius: 14px;
  }
}
