:root {
  color-scheme: light;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  font-size: 16px;
  --bg: #ffffff;
  --card: #ffffff;
  --border: #d0d5dd;
  --text: #121417;
  --muted: #5f6c79;
  --accent: #1d4ed8;
  --danger: #b91c1c;
  background-color: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  gap: 0.35rem;
  font-size: 0.95rem;
}

input,
select,
button {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  background: #ffffff;
  color: inherit;
  transition: border 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.25);
}

button {
  background: var(--accent);
  color: white;
  cursor: pointer;
  border: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}

button.secondary {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--border);
}

button.danger {
  background: var(--danger);
}

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

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.row.wrap {
  align-items: stretch;
}

.row > * {
  flex: 1;
}

.account-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.account-actions input {
  min-width: 160px;
  flex: 1 1 160px;
}

.select-group {
  min-width: 180px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

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

.small {
  font-size: 0.85rem;
}

.txn-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.txn-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  background: #ffffff;
}

.txn-item .meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.txn-item .meta span {
  font-size: 0.9rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 112, 243, 0.1);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tag.expense {
  background: rgba(198, 40, 40, 0.12);
  color: var(--danger);
}

.tag.income {
  background: rgba(0, 128, 96, 0.12);
  color: #006a4e;
}

.ledger-container {
  overflow-x: auto;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.ledger-table th,
.ledger-table td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  vertical-align: top;
  background: #ffffff;
}

.ledger-table th {
  text-align: left;
  background: rgba(29, 78, 216, 0.08);
  font-size: 0.95rem;
}

.balance-label {
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
}
