/* Portal Muniz · base visual compartilhada (verde petróleo + âmbar, Bricolage/Manrope) */
:root {
  --bg: #e9efed; --surface: #ffffff; --sunken: #f2f6f5; --ink: #132321; --muted: #5a6b68; --line: #d3dedb;
  --brand: #0d5b53; --brand-ink: #ffffff; --brand-soft: #dcece9; --accent: #c98a12;
  --ok: #1d7f46; --ok-soft: #dff1e6; --warn: #8f5d0d; --warn-soft: #f8ecd4;
  --bad: #b4372a; --bad-soft: #f8e0dc; --info: #2a64a3; --info-soft: #e0ebf7;
  --shadow: 0 1px 2px rgba(19,35,33,.06), 0 8px 24px rgba(19,35,33,.08);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1413; --surface: #141f1e; --sunken: #101918; --ink: #e3ecea; --muted: #94a5a2; --line: #273634;
    --brand: #3cae9f; --brand-ink: #04211e; --brand-soft: #173532; --accent: #eab64a;
    --ok: #52c784; --ok-soft: #14301f; --warn: #e4ad52; --warn-soft: #33270f;
    --bad: #ef7666; --bad-soft: #3a1b17; --info: #73a9e3; --info-soft: #152a40;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
a { color: var(--brand); }
.mono { font-family: var(--f-mono); font-size: .92em; }
.muted, .sub { color: var(--muted); }
.sub { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
h1 { font-family: var(--f-display); font-size: 22px; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h2 { font-family: var(--f-display); font-size: 17px; margin: 0; text-wrap: balance; }

.mark { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 21px; flex: none; }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; font-weight: 600; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linkbtn { border: 0; background: none; color: var(--brand); font-weight: 700; padding: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 16px 18px 0; }
.card-body { padding: 14px 18px 18px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field .lbl { font-size: 12px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--sunken); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.field textarea { resize: vertical; min-height: 84px; }
.field input[type="file"] { padding: 6px; font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.form-msg { margin: 0; font-size: 12.5px; color: var(--bad); font-weight: 600; }
@media (max-width: 420px) { .form { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.num { text-align: right; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .l2 { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.empty-row { text-align: center; color: var(--muted); padding: 28px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-novo, .p-aberta { color: var(--info); background: var(--info-soft); }
.p-visto, .p-subst { color: var(--muted); background: var(--sunken); }
.p-pago, .p-concluida, .p-ativo { color: var(--ok); background: var(--ok-soft); }
.p-vencido { color: var(--bad); background: var(--bad-soft); }
.p-andamento, .p-pendente { color: var(--warn); background: var(--warn-soft); }

.toasts { position: fixed; z-index: 20; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 440px; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: 13px;
  box-shadow: var(--shadow); animation: up .25s ease-out; }
.toast.err { background: var(--bad); color: var(--surface); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
