/* ============================================================
   ESTILOS GLOBAIS — Utilitários e Layout Base
   ============================================================ */

/* ── Containers ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--sm  { max-width: 640px;  }
.container--md  { max-width: 768px;  }
.container--lg  { max-width: 1024px; }
.container--xl  { max-width: 1280px; }

/* ── Grid ───────────────────────────────────────────────────── */
.grid           { display: grid; }
.grid-2         { grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3         { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4         { grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

/* ── Flex ───────────────────────────────────────────────────── */
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.gap-2          { gap: var(--space-2); }
.gap-3          { gap: var(--space-3); }
.gap-4          { gap: var(--space-4); }
.gap-6          { gap: var(--space-6); }
.gap-8          { gap: var(--space-8); }

/* ── Espaçamentos ───────────────────────────────────────────── */
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.p-4   { padding: var(--space-4); }
.p-6   { padding: var(--space-6); }

/* ── Texto ──────────────────────────────────────────────────── */
.text-xs      { font-size: var(--font-size-xs); }
.text-sm      { font-size: var(--font-size-sm); }
.text-base    { font-size: var(--font-size-base); }
.text-lg      { font-size: var(--font-size-lg); }
.text-xl      { font-size: var(--font-size-xl); }
.text-2xl     { font-size: var(--font-size-2xl); }
.text-muted   { color: var(--color-text-muted); }
.text-faint   { color: var(--color-text-faint); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.font-medium  { font-weight: var(--font-weight-medium); }
.font-semibold{ font-weight: var(--font-weight-semibold); }
.font-bold    { font-weight: var(--font-weight-bold); }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Visibilidade ───────────────────────────────────────────── */
.hidden        { display: none !important; }
.sr-only       { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }

/* ── Page Wrapper (para páginas sem sidebar) ────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Divisor ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

/* ── Loading Spinner ────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-secondary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Skeleton Loader ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-hover) 50%, var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-wave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Fade In (animação de entrada) ─────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* ── Overlay de modal ───────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: var(--z-overlay);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--color-text-muted);
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  opacity: 0.35;
}

.empty-state__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.empty-state__desc {
  font-size: var(--font-size-sm);
  max-width: 360px;
  margin: 0 auto;
}

/* ── Responsivo: mobile ─────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .hide-mobile { display: none !important; }
}

@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}
