* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f6f8;
  color: #1f2d3d;
  line-height: 1.5;
}

nav {
  background: #128C7E;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

nav a { color: #fff; text-decoration: none; margin-left: 16px; }
nav .nav-right { font-weight: 500; }

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand .logo { width: 26px; height: 26px; display: block; }
.brand strong { font-weight: 800; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

h1 { font-size: 1.6rem; margin-bottom: 8px; }
h2 { font-size: 1.15rem; }
h3 { margin-bottom: 10px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.client-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.muted { color: #66788a; font-size: .9rem; }
.center { text-align: center; margin-top: 8px; }
.danger { color: #c0392b; }
.danger-text { color: #c0392b; margin-bottom: 8px; }
.ok-text { color: #1da851; margin-bottom: 8px; font-weight: 600; }
.warn-text { color: #b45309; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  vertical-align: middle;
}
.badge-ok { background: #e6f7ee; color: #1da851; }
.badge-warn { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fde8e8; color: #c0392b; }

.banner {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: .95rem;
}
.banner-ok { background: #e6f7ee; color: #14663e; border: 1px solid #bce8d2; }
.banner-warn { background: #fef3c7; color: #7c4a03; border: 1px solid #f3d78a; }
.banner-danger { background: #fde8e8; color: #8a1f1f; border: 1px solid #f5c2c2; }
.banner-muted { background: #f1f5f9; color: #66788a; border: 1px solid #e2e8f0; }

.btn.ok { background: #1da851; }
.btn.ok:hover { background: #178a42; }
.btn.danger { background: #c0392b; }
.btn.danger:hover { background: #a03024; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stats > div {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  color: #66788a;
  font-size: .85rem;
}

.stat {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1f2d3d;
  margin-bottom: 4px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
form { display: block; }
form.inline { display: inline; }
label { display: block; font-size: .85rem; color: #33475b; margin-bottom: 10px; }
input, textarea {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.btn {
  display: inline-block;
  background: #128C7E;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: #0f7668; }

.btn.small { padding: 7px 12px; font-size: .85rem; }
.btn.mini { padding: 4px 8px; font-size: .72rem; }
.btn.wa { background: #25D366; }
.btn.wa:hover { background: #1da851; }

.link-input {
  font-family: monospace;
  background: #f8fafc;
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f7;
}

th { color: #66788a; font-weight: 600; }

.link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  text-decoration: underline;
  color: #128C7E;
}

.fee-line {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: .9rem;
  color: #33475b;
  padding: 8px 2px;
}

.fee-line strong { color: #128C7E; }

.client-hero {
  text-align: center;
  padding: 12px 0 20px;
}

.client-hero h1 { color: #128C7E; }

.chart-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.chart-legend .chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
}

.pay-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #f8fafc;
}

.pay-item:last-child { margin-bottom: 0; }

.pay-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  font-size: .9rem;
}

.pay-line > span:first-child { color: #66788a; font-weight: 600; }

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

.pay-buttons form { flex: 1; }
.pay-buttons .btn { width: 100%; }

.contract {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 20px;
  margin-top: 16px;
  font-size: .88rem;
  line-height: 1.6;
}

.contract h2 { font-size: 1.1rem; text-align: center; margin-bottom: 16px; }
.contract h4 { font-size: .95rem; margin-top: 16px; margin-bottom: 6px; color: #128C7E; }
.contract p { margin-bottom: 8px; }

.contract-notice {
  border-left: 4px solid #f59e0b;
}

.contract-notice p { margin-bottom: 10px; }

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  margin: 12px 0;
}

.check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #128C7E;
}

.row-custo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.input-custo {
  width: 90px;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
}

.input-custo:focus {
  outline: none;
  border-color: #128C7E;
  box-shadow: 0 0 0 2px rgba(18,140,126,.2);
}
