/* Componentes básicos compartilhados. Sóbrio: sem gradiente, sem sombra forte, sem animação decorativa. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.5 var(--font); }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0 0 var(--space-3); }
a { color: var(--ippi-steel); }
code, .mono { font-family: var(--font-mono); font-size: 13px; }
:focus-visible { outline: 3px solid var(--ippi-yellow); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--ippi-night); border-radius: var(--radius); background: var(--surface); color: var(--ippi-night);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--canvas); }
.btn.primary { background: var(--ippi-night); color: var(--ippi-white); }
.btn.primary:hover { background: var(--ippi-steel); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn.quiet { border-color: transparent; background: none; font-weight: 500; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

label.field { display: block; margin-bottom: var(--space-3); font-size: 13px; font-weight: 600; color: var(--ippi-steel); }
label.field > span.hint { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; }
textarea { resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--canvas); color: var(--ink-soft); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); }
.card + .card { margin-top: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: var(--space-4); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

table.data { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ippi-steel); font-weight: 600; white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--canvas); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap table.data tr:last-child td { border-bottom: 0; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ippi-silver); color: var(--ippi-night); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: #6B5300; }
.badge.dark { background: var(--ippi-night); color: var(--ippi-white); }

.notice { padding: var(--space-3) var(--space-4); border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin-bottom: var(--space-4); }
.notice.error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.notice.warn { border-color: var(--ippi-yellow); background: var(--warn-soft); }
.notice.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }

.meter { height: 8px; background: var(--ippi-silver); border-radius: 4px; overflow: hidden; min-width: 80px; }
.meter > span { display: block; height: 100%; background: var(--ippi-steel); }
.meter.full > span { background: var(--ok); }
.meter.over > span { background: var(--ippi-yellow); }
.bar-cell { width: 30%; min-width: 90px; }
.empty { padding: var(--space-5); text-align: center; color: var(--ink-soft); }
