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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button { cursor: pointer; }

ul, ol { list-style: none; }

/* ── Tipografia ── */
h1 { font-size: 1.625rem; font-weight: 700; line-height: 1.25; }
h2 { font-size: 1.25rem;  font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.0625rem; font-weight: 600; }
h4 { font-size: .9375rem;  font-weight: 600; }

/* ── Utilitários ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }

.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }

.mt-1 { margin-top:.25rem; }
.mt-2 { margin-top:.5rem; }
.mt-3 { margin-top:.75rem; }
.mt-4 { margin-top:1rem; }
.mb-2 { margin-bottom:.5rem; }
.mb-4 { margin-bottom:1rem; }
.gap-2 { gap:.5rem; }
.gap-3 { gap:.75rem; }

.flex { display:flex; }
.flex-col { flex-direction:column; }
.items-center { align-items:center; }
.justify-between { justify-content:space-between; }
.flex-1 { flex:1; }
.flex-wrap { flex-wrap:wrap; }

.hidden { display:none !important; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-success  { background: var(--success-light);  color: var(--success); }
.badge-danger   { background: var(--danger-light);   color: var(--danger); }
.badge-warning  { background: var(--warning-light);  color: var(--warning); }
.badge-info     { background: var(--info-light);     color: var(--info); }
.badge-default  { background: var(--border-light);   color: var(--text-muted); }
.badge-primary  { background: var(--primary-light);  color: var(--primary); }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  background: var(--secondary);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: var(--radius);
  font-size: .875rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  max-width: 320px;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.success { background: var(--success); }
#toast.danger  { background: var(--danger); }
