:root {
  --green: #0b6b3a;
  --green-dark: #084d2a;
  --red: #c0392b;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
}

.app-header {
  background: var(--green);
  color: #fff;
  padding: 12px 16px;
  position: sticky; top: 0; z-index: 10;
}
.app-header h1 { margin: 0 0 8px 0; font-size: 1.25rem; }
.app-header nav { display: flex; gap: 6px; flex-wrap: wrap; }
.app-header button {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .85rem;
  cursor: pointer;
}
.app-header button.active { background: #fff; color: var(--green); font-weight: 600; }

main { padding: 16px; max-width: 720px; margin: 0 auto; }

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px 0; font-size: 1rem; }
.card .meta { color: var(--muted); font-size: .85rem; }

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: var(--green);
  color: #fff;
  font-size: .95rem;
  cursor: pointer;
  margin-right: 6px;
  margin-top: 6px;
}
.btn.secondary { background: #e5e7eb; color: var(--text); }
.btn.danger { background: var(--red); }
.btn.sms { background: #2563eb; }

input, select, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 8px;
  background: #fff;
}
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }

.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.balance { font-weight: 700; color: var(--red); }
.balance.zero { color: var(--green); }

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

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: #fff; border-radius: 12px;
  padding: 18px; width: 90%; max-width: 420px;
  max-height: 85vh; overflow: auto;
}

/* Toast */
.toast {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: #111; color: #fff;
  padding: 10px 16px; border-radius: 999px;
  font-size: .9rem; z-index: 200;
  animation: fade 2.5s ease forwards;
}
@keyframes fade {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  15%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; }
}

/* Add this at the end of style.css */

/* Report view */
.report-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--green);
}
.report-header h2 { margin: 0 0 5px 0; color: var(--green); }
.report-header .period { color: var(--muted); font-size: .9rem; }

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.summary-card {
  background: var(--card);
  padding: 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}
.summary-card .label { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.summary-card .value { font-size: 1.4rem; font-weight: 700; color: var(--green); }
.summary-card .value.negative { color: var(--red); }

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}
.report-table th {
  background: var(--green);
  color: #fff;
  padding: 10px;
  text-align: left;
  font-size: .85rem;
}
.report-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.report-table tr:last-child td { border-bottom: none; }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Print styles */
@media print {
  body { background: #fff; }
  .app-header, .btn, #modal-root, #toast-root { display: none !important; }
  main { padding: 0; max-width: 100%; }
  .card, .summary-card, .report-table { box-shadow: none; border: 1px solid #ddd; }
  .report-header { border-bottom: 2px solid #000; }
  .report-table th { background: #f0f0f0; color: #000; }
  @page { margin: 1cm; }
}