/* Meu BaaS Design System v1 — kit oficial de marca.
   Rápido (zero dependências externas) e consistente do painel aos apps gerados.
   Uso: <link rel="stylesheet" href="{ORIGEM_DO_PAINEL}/brand.css"> */
:root {
  --bg: #f8fafc; --surface: #ffffff; --ink: #0f172a; --muted: #64748b;
  --faint: #94a3b8; --line: #e6e9f0; --line-soft: #eef1f6;
  --blue: #4f46e5; --blue-dark: #4338ca; --blue-soft: #eef0fe;
  --green: #16a34a; --green-soft: #e9f7ef;
  --amber: #b45309; --amber-soft: #fdf3e3;
  --red: #dc2626; --red-soft: #fdecec;
  --radius: 12px;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -0.02em; margin: 0; }
.num, .stat .v { font-variant-numeric: tabular-nums; }
.mono, code { font-family: var(--font-mono); }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 11px; }
.row { display: flex; gap: 8px; align-items: center; }

/* micro-rótulo em caixa alta — assinatura tipográfica da marca */
.kicker, .nav-label, th {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
}

/* botões */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; font-size: 13px; font-weight: 600; padding: 9px 14px; cursor: pointer; border: 1px solid transparent; text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: #f8fafc; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; justify-content: center; padding: 11px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: #f1f5f9; color: var(--ink); }
.icon-btn.bordered { border-color: var(--line); background: var(--surface); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.mini-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; border-radius: 7px; font-size: 11px; font-weight: 600; color: #334155; padding: 4px 9px; cursor: pointer; white-space: nowrap; }
.mini-btn:hover { background: #f1f5f9; }
.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 20px; height: 20px; }
.mini-btn .ic { width: 12px; height: 12px; }

/* cartões e estatísticas */
.card, .stat, .inst, .table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card { padding: 24px; }
.stat { padding: 14px 18px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.inst { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.inst-name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.inst-slug { font-family: var(--font-mono); font-size: 12px; color: var(--faint); margin-top: 1px; }

/* selos de status — só aqui a cor é funcional */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-green { background: var(--green-soft); color: #15803d; }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-gray { background: #f1f5f9; color: var(--muted); }
.pill-blue { background: var(--blue-soft); color: var(--blue-dark); }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-green { background: #22c55e; } .dot-amber { background: #f59e0b; } .dot-gray { background: #cbd5e1; }

/* alertas */
.alert { border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.alert-info { background: var(--blue-soft); color: var(--blue-dark); }
.alert-success { background: var(--green-soft); color: #15803d; }
.alert-warn { background: var(--amber-soft); color: var(--amber); }
.alert-error { background: var(--red-soft); color: var(--red); }
.err { display: none; font-size: 13px; color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 9px 12px; margin-top: 12px; }
.err.show { display: block; }

/* formulários */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--faint); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 12px; font-size: 14px; color: var(--ink); background: #fff; font-family: var(--font-ui); }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
.field input::placeholder { color: #b3bac7; }

/* tabelas */
.table-card { overflow-x: auto; }
table { width: 100%; font-size: 13px; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
tr:last-child td { border-bottom: 0; }

/* modal */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(440px, 92vw); box-shadow: 0 12px 40px rgba(15,23,42,.16); }
dialog::backdrop { background: rgba(15,23,42,.45); }
dialog .body { padding: 24px; }
dialog h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.01em; }
dialog .desc { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* blocos utilitários */
.url-block { background: #f8fafc; border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 11px; display: flex; flex-direction: column; gap: 7px; }
.url-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.url-row .tag { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); width: 52px; flex: none; }
.url-row code { font-size: 11.5px; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.code { font-family: var(--font-mono); font-size: 12px; background: #f1f5f9; border: 1px solid var(--line-soft); border-radius: 7px; padding: 2px 7px; }
.empty { border: 1.5px dashed #d4d9e3; border-radius: var(--radius); background: var(--surface); text-align: center; padding: 56px 20px; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue-dark); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
#toast { display: none; position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; font-size: 13px; font-weight: 500; padding: 10px 18px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 60; max-width: 92vw; }
#toast.show { display: block; }
