/* ═══════════════════════════════════════════════════════════════════
   global.css — Patrimônio Inteligente
   Variáveis de design, reset e estilos base
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variáveis de design ───────────────────────────────────────────── */
:root {
  /* Paleta principal — identidade da Prefeitura de Oriximiná */
  --color-primary-900: #0d1f3c;
  --color-primary-800: #1a2e4a;
  --color-primary-700: #1e3a5f;
  --color-primary-600: #24487a;
  --color-primary-500: #2b5797;
  --color-primary-400: #4a78b8;
  --color-primary-300: #7aa3d0;
  --color-primary-200: #b8d0e8;
  --color-primary-100: #dce8f4;
  --color-primary-50:  #f0f6fb;

  /* Paleta de acento — verde institucional */
  --color-accent-700: #1a5c2e;
  --color-accent-600: #1f7236;
  --color-accent-500: #258a42;
  --color-accent-400: #3aaa5a;
  --color-accent-100: #d4f0dd;

  /* Cores semânticas */
  --color-success:      #2e7d32;
  --color-success-bg:   #e8f5e9;
  --color-warning:      #e65100;
  --color-warning-bg:   #fff3e0;
  --color-danger:       #c62828;
  --color-danger-bg:    #ffebee;
  --color-info:         #01579b;
  --color-info-bg:      #e1f5fe;

  /* Neutrals */
  --color-white:        #ffffff;
  --color-gray-50:      #f8f9fa;
  --color-gray-100:     #f1f3f5;
  --color-gray-200:     #e9ecef;
  --color-gray-300:     #dee2e6;
  --color-gray-400:     #ced4da;
  --color-gray-500:     #adb5bd;
  --color-gray-600:     #6c757d;
  --color-gray-700:     #495057;
  --color-gray-800:     #343a40;
  --color-gray-900:     #212529;

  /* Tipografia */
  --font-family-base:   'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-size-xs:       0.75rem;    /* 12px */
  --font-size-sm:       0.875rem;   /* 14px */
  --font-size-base:     1rem;       /* 16px */
  --font-size-md:       1.125rem;   /* 18px */
  --font-size-lg:       1.25rem;    /* 20px */
  --font-size-xl:       1.5rem;     /* 24px */
  --font-size-2xl:      1.875rem;   /* 30px */
  --font-size-3xl:      2.25rem;    /* 36px */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semi:   600;
  --font-weight-bold:   700;
  --line-height-tight:  1.25;
  --line-height-base:   1.5;
  --line-height-loose:  1.75;

  /* Espaçamento */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Bordas e sombras */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl:  0 20px 25px rgba(0,0,0,.08), 0 10px 10px rgba(0,0,0,.04);

  /* Transições */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Z-index scale */
  --z-base:     0;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-modal:    300;
  --z-toast:    400;
}

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

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

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-base);
  color: var(--color-gray-900);
  background-color: var(--color-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semi);
  line-height: var(--line-height-tight);
  color: var(--color-gray-900);
}

/* ── Utilitários de estado (aplicados por JS) ──────────────────────── */
.is-hidden    { display: none !important; }
.is-loading   { opacity: .6; pointer-events: none; cursor: wait; }

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

.text-truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--color-gray-600); }
.text-small   { font-size: var(--font-size-sm); }
.text-danger  { color: var(--color-danger); }
.text-success { color: var(--color-success); }
