/* ═══════════════════════════════════════════════════════════
   Projetare — core.css
   Fonte ÚNICA do design system (tokens v6 + reset + base + header).
   Carregue ANTES do CSS específico de cada tela; a tela só sobrescreve
   o que é dela. Não duplicar tokens nas folhas por página.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Backgrounds — Dark Navy (v6 oficial) */
  --bg-primary: #0A0F1A;
  --bg-secondary: #0D1520;
  --bg-card: #111827;
  --bg-elevated: #1A2332;
  --bg-input: #0D1520;
  --bg-sidebar: #0A0F1A;

  /* Accent — Orange */
  --accent: #FF6B2B;
  --accent-hover: #E55A1A;
  --accent-subtle: rgba(255, 107, 43, 0.08);
  --accent-glow: rgba(255, 107, 43, 0.25);
  --accent-gradient: linear-gradient(135deg, #FF6B2B, #E55A1A);

  /* Borders */
  --border: #1E2D42;
  --border-hover: rgba(255, 255, 255, 0.15);
  --border-active: rgba(255, 107, 43, 0.5);

  /* Text (v6 — contraste AA sobre #0A0F1A) */
  --text-primary: #FFFFFF;
  --text-secondary: #8899AA;
  --text-muted: #556677;

  /* Status */
  --status-online: #FF6B2B;
  --status-offline: #FF4444;
  --green: #2ECC71;
  --green-bg: #0D2A1A;
  --green-border: #1A5C30;
  --red: #E74C3C;
  --red-bg: #2A0D0D;
  --red-border: #5C1A1A;
  --yellow: #F39C12;
  --yellow-bg: #2A1F0D;
  --yellow-border: #5C3D0D;

  /* Shadows */
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);

  /* Typography */
  --font: 'Syne', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Shape & spacing */
  --radius: 16px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --sidebar-width: 260px;

  /* Transitions */
  --ease: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: rgba(255, 107, 43, 0.3); color: #FFFFFF; }

/* ── Acessibilidade: foco visível consistente ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Não some o foco para quem navega por teclado */
a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Header compartilhado (dashboard, admin) ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 12px; }

.brand-logo { width: 36px; height: 36px; }

.header-brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.header-badge {
  padding: 3px 10px;
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-right { display: flex; align-items: center; gap: 16px; }

.user-name { font-size: 14px; color: var(--text-secondary); }

.btn-logout {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--ease);
}

.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Utilitário de acessibilidade ── */
.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;
}
