:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1a1f2c;
  --muted: #5c6578;
  --line: #e3e7ee;
  --accent: #1f7a4c;
  --accent-2: #0f5f9a;
  --warn: #c45c16;
  --danger: #c62828;
  --ok: #1b7f3a;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(20, 30, 50, 0.06);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: linear-gradient(180deg, #eef3f0 0%, var(--bg) 40%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.4;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { max-width: 720px; margin: 0 auto; padding: 12px 14px 96px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.brand { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em; }
.brand span { color: var(--accent); }
.user-chip { font-size: 0.85rem; color: var(--muted); text-align: right; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

h1 { font-size: 1.35rem; margin: 0 0 10px; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 0.92rem; }

.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 16px; border-radius: 12px;
  border: 0; font-weight: 700; font-size: 1rem; cursor: pointer;
  text-decoration: none; width: 100%;
}
.btn:hover { text-decoration: none; filter: brightness(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: #e8eef5; color: var(--text); }
.btn-warn { background: #fff1e6; color: var(--warn); border: 1px solid #f0d0b4; }
.btn-danger { background: #fdecea; color: var(--danger); border: 1px solid #f0c2c2; }
.btn-ok { background: #e8f6ec; color: var(--ok); border: 1px solid #bfe5ca; }
.btn-row { display: grid; gap: 8px; margin-top: 12px; }
.btn-row.two { grid-template-columns: 1fr 1fr; }

label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: 0.92rem; }
input, select, textarea {
  width: 100%; min-height: 48px; border-radius: 12px;
  border: 1px solid var(--line); padding: 12px 14px; font-size: 1rem;
  background: #fff; color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
.field-hint { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

.list { display: grid; gap: 10px; }
.list-item {
  display: block; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; color: inherit;
}
.list-item:hover { border-color: #c9d4e3; text-decoration: none; }
.list-item .title { font-weight: 700; margin-bottom: 4px; }
.list-item .meta { color: var(--muted); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-block; padding: 4px 8px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; background: #eef1f5;
}
.badge.aguardando { background: #fff4df; color: #9a5b00; }
.badge.aprovado { background: #e7f7ea; color: #176b2e; }
.badge.pago { background: #e7f1fb; color: #0f5f9a; }
.badge.rejeitado { background: #fdecea; color: #a11818; }
.badge.ajuste { background: #ffe8dc; color: #a14400; }

.copy-box {
  display: flex; gap: 8px; align-items: stretch; margin: 8px 0;
}
.copy-box input {
  flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
}
.copy-box button {
  flex: 0 0 auto; min-width: 88px; border-radius: 12px; border: 0;
  background: var(--accent-2); color: #fff; font-weight: 700; cursor: pointer;
}

.flash {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 600;
}
.flash.ok { background: #e8f6ec; color: var(--ok); }
.flash.error { background: #fdecea; color: var(--danger); }

.nav-bottom {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: center; gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.nav-bottom a {
  flex: 1; max-width: 180px; text-align: center; padding: 10px 6px;
  border-radius: 12px; color: var(--muted); font-size: 0.82rem; font-weight: 700;
}
.nav-bottom a.active { background: #e9f4ee; color: var(--accent); }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}
.login-card { width: 100%; max-width: 420px; }
.login-card h1 { text-align: center; }
.detail-kv { display: grid; gap: 8px; margin: 10px 0; }
.detail-kv div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.detail-kv strong { font-weight: 600; color: var(--muted); }
.money { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }

.table-simple { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table-simple th, .table-simple td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.stack { display: grid; gap: 10px; }
@media (min-width: 720px) {
  .btn-row.desktop-row { grid-template-columns: repeat(2, 1fr); }
}
