/* =================================================================
   DESIGN SYSTEM PREMIUM - Portal IntGest
   Versão: 1.0.0
   Data: Janeiro 2026

   Este arquivo contém:
   - CSS Variables (Light, Dark, High Contrast)
   - Estilos base de tipografia
   - Componentes de UI padronizados
   - Utilitários de acessibilidade
   ================================================================= */

/* =================================================================
   0. ALPINE.JS UTILITIES
   ================================================================= */

/* Oculta elementos com x-cloak até o Alpine.js inicializar */
[x-cloak] {
  display: none !important;
}

/* =================================================================
   1. CSS VARIABLES - THEME TOKENS
   ================================================================= */

:root {
  /* === CORES PRIMÁRIAS (Azul Governamental IGE — #0C4DA2) === */
  --primary: 214 86% 34%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 214 87% 28%;
  --primary-subtle: 214 85% 96%;

  /* === ACENTO INSTITUCIONAL (Dourado sóbrio — #B29629) === */
  --gold: 44 63% 43%;
  --gold-foreground: 0 0% 100%;
  --gold-subtle: 44 70% 95%;

  /* === CORES DE SUPERFÍCIE === */
  --background: 220 20% 98%;
  --foreground: 222 47% 11%;

  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;

  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 11%;

  /* === CORES MUTADAS === */
  --muted: 214 32% 96%;
  --muted-foreground: 215 16% 42%;

  /* === CORES DE DESTAQUE === */
  --accent: 214 85% 96%;
  --accent-foreground: 214 86% 28%;

  /* === CORES DESTRUTIVAS === */
  --destructive: 0 72% 48%;
  --destructive-foreground: 0 0% 100%;

  /* === BORDAS E INPUTS === */
  --border: 214 25% 90%;
  --input: 214 25% 88%;
  --ring: 214 86% 40%;

  /* === SIDEBAR === */
  --sidebar-background: 216 33% 14%;
  --sidebar-foreground: 214 20% 82%;
  --sidebar-muted-foreground: 214 15% 60%;
  --sidebar-primary: 214 86% 56%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 216 28% 20%;
  --sidebar-accent-foreground: 0 0% 100%;
  --sidebar-border: 216 25% 22%;
  --sidebar-ring: 214 86% 56%;

  /* === RADIUS (enterprise: 6px) === */
  --radius: 0.375rem;

  /* === TRANSITIONS === */
  --transition-fast: 150ms;
  --transition-normal: 250ms;
  --transition-slow: 350ms;

  /* === Z-INDEX === */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
  --z-cookie-banner: 1090;
  --z-cookie-backdrop: 1091;
  --z-cookie-modal: 1092;

  /* === LAYOUT === */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 64px;
  --header-height: 56px;

  /* === TYPOGRAPHY SCALE (enterprise admin) === */
  --text-2xs: 0.6875rem;   /* 11px — eyebrows, labels uppercase, kbd */
  --text-xs:  0.75rem;     /* 12px — helpers, hints, badges */
  --text-sm:  0.8125rem;   /* 13px — body padrão do admin */
  --text-md:  0.875rem;    /* 14px — inputs grandes, btn-lg */
  --text-base: 0.9375rem;  /* 15px — brand, títulos menores */
  --text-lg:  1rem;        /* 16px — subtítulos de seção */
  --text-xl:  1.125rem;    /* 18px — títulos de modal */
  --text-2xl: 1.375rem;    /* 22px — page title */

  /* === SPACING SCALE (múltiplos de 4px) === */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */

  /* === ELEVATION (shadows enterprise, suaves) === */
  --shadow-xs: 0 1px 2px 0 hsl(215 25% 15% / 0.04);
  --shadow-sm: 0 1px 2px 0 hsl(215 25% 15% / 0.05), 0 1px 3px 0 hsl(215 25% 15% / 0.06);
  --shadow-md: 0 2px 4px -1px hsl(215 25% 15% / 0.06), 0 4px 8px -2px hsl(215 25% 15% / 0.08);
  --shadow-lg: 0 4px 8px -2px hsl(215 25% 15% / 0.08), 0 12px 24px -4px hsl(215 25% 15% / 0.12);
  --shadow-xl: 0 8px 16px -4px hsl(215 25% 15% / 0.10), 0 24px 48px -12px hsl(215 25% 15% / 0.18);

  /* === CONTROLS (alturas padronizadas) === */
  --control-sm: 1.75rem;   /* 28px — btn-sm, inputs compactos */
  --control-md: 2rem;      /* 32px — botão/input padrão */
  --control-lg: 2.375rem;  /* 38px — formulários principais */
}

/* === DARK MODE === */
.dark {
  --primary: 214 86% 56%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 214 86% 62%;
  --primary-subtle: 214 40% 18%;

  --gold: 44 70% 58%;
  --gold-foreground: 222 47% 11%;
  --gold-subtle: 44 40% 18%;

  --background: 222 47% 7%;
  --foreground: 214 20% 96%;

  --card: 222 40% 12%;
  --card-foreground: 214 20% 96%;

  --popover: 222 40% 12%;
  --popover-foreground: 214 20% 96%;

  --muted: 217 30% 17%;
  --muted-foreground: 215 15% 65%;

  --accent: 214 40% 20%;
  --accent-foreground: 214 86% 78%;

  --destructive: 0 72% 52%;
  --destructive-foreground: 0 0% 100%;

  --border: 217 25% 20%;
  --input: 217 25% 20%;
  --ring: 214 86% 56%;

  --sidebar-background: 222 47% 5%;
  --sidebar-foreground: 214 20% 82%;
  --sidebar-muted-foreground: 214 15% 55%;
  --sidebar-primary: 214 86% 62%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 217 28% 14%;
  --sidebar-accent-foreground: 0 0% 100%;
  --sidebar-border: 217 25% 14%;
  --sidebar-ring: 214 86% 62%;
}

/* === HIGH CONTRAST (WCAG AAA) === */
/* JS ContrastManager applies .contrast class via default-scripts-init.js */
.contrast,
.high-contrast {
  --primary: 220 100% 30%;
  --primary-foreground: 0 0% 100%;

  --background: 0 0% 100%;
  --foreground: 0 0% 0%;

  --card: 0 0% 100%;
  --card-foreground: 0 0% 0%;

  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 0%;

  --muted: 0 0% 96%;
  --muted-foreground: 0 0% 20%;

  --accent: 0 0% 96%;
  --accent-foreground: 0 0% 0%;

  --border: 0 0% 0%;
  --input: 0 0% 0%;
  --ring: 220 100% 30%;

  --sidebar-background: 0 0% 100%;
  --sidebar-foreground: 0 0% 0%;
  --sidebar-border: 0 0% 0%;
}

.contrast.dark,
.high-contrast.dark {
  --background: 0 0% 0%;
  --foreground: 0 0% 100%;

  --card: 0 0% 0%;
  --card-foreground: 0 0% 100%;

  --popover: 0 0% 0%;
  --popover-foreground: 0 0% 100%;

  --muted: 0 0% 15%;
  --muted-foreground: 0 0% 85%;

  --border: 0 0% 100%;
  --input: 0 0% 100%;

  --sidebar-background: 0 0% 0%;
  --sidebar-foreground: 0 0% 100%;
}

/* === DALTONISM FILTER (Deuteranopia) === */
/* JS DaltonismManager injects SVG #deuteranopia filter and applies this class */
.daltonism-filter {
  filter: url(#deuteranopia);
}

/* Elements that should bypass daltonism filter (images, videos, maps) */
.daltonism-filter img,
.daltonism-filter video,
.daltonism-filter iframe,
.daltonism-filter .ignore-contrast {
  filter: none;
}

/* =================================================================
   2. BASE STYLES
   ================================================================= */

*,
*::before,
*::after {
  border-color: hsl(var(--border));
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =================================================================
   3. TYPOGRAPHY
   ================================================================= */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 600;
  line-height: 1.25;
  color: hsl(var(--foreground));
  margin-bottom: 0.5em;
}

h1, .h1 { font-size: 2rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.125rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: 0.875rem; }

.display-lg {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
}

.display {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}

.text-muted {
  color: hsl(var(--muted-foreground));
}

/* =================================================================
   4. FOCUS STATES (WCAG 2.1 AA)
   ================================================================= */

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: calc(var(--radius) - 2px);
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* =================================================================
   5. SKIP LINKS (Accessibility)
   ================================================================= */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 8px 16px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 500;
  transition: top var(--transition-fast) ease;
}

.skip-link:focus {
  top: 0;
}

/* =================================================================
   6. BUTTONS
   ================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: -0.005em;
  line-height: 1;
  border-radius: var(--radius);
  padding: 0 var(--space-3);
  height: var(--control-md);
  transition: background-color var(--transition-fast) ease, border-color var(--transition-fast) ease, color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button */
.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.08);
}

.btn-primary:hover:not(:disabled) {
  background-color: hsl(var(--primary-hover));
}

.btn-primary:active:not(:disabled) {
  background-color: hsl(var(--primary-hover));
}

/* Secondary Button */
.btn-secondary {
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.btn-secondary:hover:not(:disabled) {
  background-color: hsl(var(--muted));
  border-color: hsl(var(--input));
}

/* Outline Button */
.btn-outline {
  background-color: hsl(var(--card));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover:not(:disabled) {
  background-color: hsl(var(--accent));
  border-color: hsl(var(--primary) / 0.4);
  color: hsl(var(--accent-foreground));
}

/* Ghost Button */
.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background-color: hsl(var(--accent));
}

/* Danger Button */
.btn-danger {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-danger:hover:not(:disabled) {
  background-color: hsl(0 84% 50%);
}

/* Success Button */
.btn-success {
  background-color: hsl(160 84% 39%);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background-color: hsl(160 84% 35%);
}

/* Warning Button */
.btn-warning {
  background-color: hsl(43 96% 56%);
  color: hsl(0 0% 0%);
}

.btn-warning:hover:not(:disabled) {
  background-color: hsl(43 96% 50%);
}

/* Button Sizes */
.btn-sm {
  height: var(--control-sm);
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  gap: var(--space-1);
}

.btn-lg {
  height: var(--control-lg);
  padding: 0 var(--space-4);
  font-size: var(--text-md);
}

.btn-icon {
  padding: 0;
  width: var(--control-md);
}

.btn-icon-sm {
  padding: 0;
  width: var(--control-sm);
  height: var(--control-sm);
}

.btn-icon-lg {
  padding: 0;
  width: var(--control-lg);
  height: var(--control-lg);
}

/* Button with loading state */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* =================================================================
   7. CARDS
   ================================================================= */

.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
}

.card-hover:hover {
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: 0 2px 8px -2px rgba(12, 77, 162, 0.12);
}

.card-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
}

.card-title {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.3);
}

/* KPI Card */
.kpi-card {
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--muted) / 0.5) 100%);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, hsl(var(--primary)) 0%, hsl(199 89% 70%) 100%);
}

.kpi-card.kpi-success::before {
  background: linear-gradient(180deg, hsl(160 84% 39%) 0%, hsl(160 84% 60%) 100%);
}

.kpi-card.kpi-warning::before {
  background: linear-gradient(180deg, hsl(43 96% 56%) 0%, hsl(43 96% 70%) 100%);
}

.kpi-card.kpi-danger::before {
  background: linear-gradient(180deg, hsl(0 84% 60%) 0%, hsl(0 84% 75%) 100%);
}

.kpi-card.kpi-info::before {
  background: linear-gradient(180deg, hsl(262 83% 58%) 0%, hsl(262 83% 72%) 100%);
}

.kpi-value {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1.2;
}

.kpi-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.kpi-trend.up {
  color: hsl(160 84% 39%);
}

.kpi-trend.down {
  color: hsl(0 84% 60%);
}

/* =================================================================
   8. BADGES
   ================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-primary {
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.badge-secondary {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.badge-success {
  background-color: hsl(160 84% 39% / 0.1);
  color: hsl(160 84% 39%);
}

.badge-warning {
  background-color: hsl(43 96% 56% / 0.1);
  color: hsl(43 74% 49%);
}

.badge-danger {
  background-color: hsl(0 84% 60% / 0.1);
  color: hsl(0 84% 60%);
}

.badge-info {
  background-color: hsl(217 91% 60% / 0.1);
  color: hsl(217 91% 60%);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius);
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.status-badge-active {
  background-color: hsl(160 84% 39% / 0.1);
  color: hsl(160 84% 39%);
}

.status-badge-pending {
  background-color: hsl(43 96% 56% / 0.1);
  color: hsl(43 74% 49%);
}

.status-badge-inactive {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.status-badge-error {
  background-color: hsl(0 84% 60% / 0.1);
  color: hsl(0 84% 60%);
}

/* =================================================================
   9. FORMS
   ================================================================= */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: var(--space-2);
}

.form-label.required::after {
  content: ' *';
  color: hsl(var(--destructive));
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: var(--control-md);
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.5;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea {
  height: auto;
  padding: var(--space-2) var(--space-3);
  min-height: 5rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: hsl(var(--muted-foreground));
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background-color: hsl(var(--muted));
  cursor: not-allowed;
  opacity: 0.7;
}

/* Error state */
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: hsl(var(--destructive));
}

.form-input.is-invalid:focus,
.form-select.is-invalid:focus,
.form-textarea.is-invalid:focus {
  box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.1);
}

/* Success state */
.form-input.is-valid,
.form-select.is-valid,
.form-textarea.is-valid {
  border-color: hsl(160 84% 39%);
}

.form-error {
  font-size: var(--text-xs);
  color: hsl(var(--destructive));
  margin-top: var(--space-1);
}

.form-help {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  margin-top: var(--space-1);
}

/* Checkbox and Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.form-check-input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
  border: 1px solid hsl(var(--input));
  border-radius: 0.25rem;
  transition: all var(--transition-fast);
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

.form-check-label {
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

/* Input Group */
.input-group {
  display: flex;
}

.input-group .form-input {
  flex: 1;
  border-radius: 0;
}

.input-group .form-input:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.input-group .form-input:last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--input));
  color: hsl(var(--muted-foreground));
}

.input-group-text:first-child {
  border-right: none;
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.input-group-text:last-child {
  border-left: none;
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

/* =================================================================
   10. TABLES
   ================================================================= */

.table-container {
  overflow-x: auto;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  background-color: hsl(var(--muted) / 0.6);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: hsl(var(--accent) / 0.4);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Striped Table */
.table-striped tbody tr:nth-child(odd) {
  background-color: hsl(var(--muted) / 0.2);
}

/* Table Actions */
.table-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* =================================================================
   11. ALERTS
   ================================================================= */

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid;
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.alert-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-info {
  background-color: hsl(217 91% 60% / 0.1);
  border-color: hsl(217 91% 60% / 0.3);
  color: hsl(217 91% 50%);
}

.alert-success {
  background-color: hsl(160 84% 39% / 0.1);
  border-color: hsl(160 84% 39% / 0.3);
  color: hsl(160 84% 30%);
}

.alert-warning {
  background-color: hsl(43 96% 56% / 0.1);
  border-color: hsl(43 96% 56% / 0.3);
  color: hsl(43 74% 40%);
}

.alert-danger {
  background-color: hsl(0 84% 60% / 0.1);
  border-color: hsl(0 84% 60% / 0.3);
  color: hsl(0 84% 50%);
}

/* Dismissible Alert */
.alert-dismissible {
  position: relative;
  padding-right: 3rem;
}

.alert-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.alert-close:hover {
  opacity: 1;
}

/* =================================================================
   12. MODALS (Alpine.js)
   ================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  backdrop-filter: blur(4px);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: transparent;
  z-index: var(--z-modal);
  max-width: 90vw;
  display: none;
}

/* Modal quando visível (classe hidden removida via JS) */
.modal:not(.hidden) {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Garantir que .hidden sobrescreva o display do modal */
.modal.hidden {
  display: none !important;
}

.modal-sm { width: 24rem; }
.modal-md { width: 32rem; }
.modal-lg { width: 48rem; }
.modal-xl { width: 64rem; }
.modal-full { width: calc(100vw - 2rem); height: calc(100vh - 2rem); }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
  color: hsl(var(--muted-foreground));
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0; /* Importante para flexbox scrolling */
}

/* Garantir scroll no container de conteúdo do modal */
#modal-content {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0; /* Essencial para permitir scroll em flex container */
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* =================================================================
   13. DROPDOWNS (Alpine.js)
   ================================================================= */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 12rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: var(--z-dropdown);
  padding: 0.25rem;
}

.dropdown-menu-left {
  right: auto;
  left: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  text-decoration: none;
}

.dropdown-item:hover {
  background-color: hsl(var(--accent));
}

.dropdown-item.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.dropdown-item.danger {
  color: hsl(var(--destructive));
}

.dropdown-item.danger:hover {
  background-color: hsl(var(--destructive) / 0.1);
}

.dropdown-divider {
  height: 1px;
  background-color: hsl(var(--border));
  margin: 0.25rem 0;
}

.dropdown-header {
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =================================================================
   13.5. ENTERPRISE ADMIN PATTERNS (IGE)
   Classes utilitárias para o shell admin premium.
   ================================================================= */

/* Page Header — sóbrio, tipográfico, sem ícones gigantes */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid hsl(var(--border));
}

.page-header__title {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: hsl(var(--foreground));
  line-height: 1.3;
  margin: 0;
}

.page-header__title--wrap {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.page-header__subtitle {
  font-size: var(--text-sm);
  color: hsl(var(--muted-foreground));
  margin-top: var(--space-1);
  line-height: 1.5;
}

.page-header__eyebrow {
  display: inline-block;
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--primary));
  margin-bottom: var(--space-1);
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Data Toolbar — barra de ações sobre a lista */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

.toolbar__search {
  position: relative;
  flex: 1 1 16rem;
  min-width: 14rem;
}

.toolbar__search input {
  width: 100%;
  height: var(--control-md);
  padding: 0 var(--space-3) 0 2rem;
  font-size: var(--text-sm);
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

.toolbar__search input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

.toolbar__search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-sm);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

.toolbar__spacer { flex: 1; }

.toolbar__count {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}

.toolbar__count strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}

/* Data Card — wrapper de tabela colado na toolbar */
.data-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.data-card--standalone {
  border-radius: var(--radius);
}

/* Filter Drawer — offcanvas lateral para filtros */
.filter-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 36, 69, 0.4);
  backdrop-filter: blur(2px);
  z-index: var(--z-modal-backdrop);
}

.filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 22rem;
  max-width: 92vw;
  background-color: hsl(var(--card));
  border-left: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-xl);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
}

.filter-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
}

.filter-drawer__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
}

.filter-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

.filter-drawer__footer {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.4);
}

/* Table Row Actions */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  opacity: 0.7;
  transition: opacity var(--transition-fast) ease;
}

.table tbody tr:hover .row-actions { opacity: 1; }

.row-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-sm);
  height: var(--control-sm);
  border-radius: var(--radius);
  color: hsl(var(--muted-foreground));
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
}

.row-action-btn:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--primary));
  border-color: hsl(var(--border));
}

.row-action-btn.danger:hover,
.row-action-btn--danger:hover {
  background-color: hsl(var(--destructive) / 0.08);
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.3);
}

/* Form Layout — 2 colunas (form + meta) */
.form-layout {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1100px) {
  .form-layout.has-aside {
    grid-template-columns: minmax(0, 1fr) 18rem;
  }
}

.form-section {
  padding: var(--space-5);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--card));
  box-shadow: var(--shadow-xs);
}

.form-section + .form-section {
  margin-top: var(--space-4);
}

.form-section__title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: hsl(var(--foreground));
  margin: 0 0 var(--space-1);
}

.form-section__hint {
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
  margin: 0 0 var(--space-4);
}

.form-section__divider {
  height: 1px;
  background-color: hsl(var(--border));
  margin: var(--space-4) 0;
}

.form-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-aside__card {
  padding: var(--space-4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--muted) / 0.4);
}

.form-aside__label {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: var(--space-1);
}

/* Sticky Form Footer */
.form-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) calc(-1 * var(--space-4)) calc(-1 * var(--space-4));
  background-color: hsl(var(--card) / 0.95);
  backdrop-filter: blur(6px);
  border-top: 1px solid hsl(var(--border));
  border-radius: 0 0 var(--radius) var(--radius);
}

.form-footer__hint {
  margin-right: auto;
  font-size: var(--text-xs);
  color: hsl(var(--muted-foreground));
}


.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  max-height: 100vh;
  background-color: hsl(var(--sidebar-background));
  border-right: 1px solid hsl(var(--sidebar-border));
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-fixed);
  transition: width var(--transition-normal) ease, transform var(--transition-normal) ease;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-header {
  padding: 0.5rem;
  justify-content: center;
}

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-header > div:not(.sidebar-logo),
.sidebar.collapsed .sidebar-group-label,
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-search,
.sidebar.collapsed .accordion-chevron {
  display: none;
}

.sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 0.75rem;
}

.sidebar-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid hsl(var(--sidebar-border));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--header-height);
}

.sidebar-logo {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.sidebar-brand {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: hsl(var(--sidebar-primary-foreground));
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--sidebar-border)) transparent;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid hsl(var(--sidebar-border));
}

/* Sidebar Navigation */
.sidebar-group {
  margin-bottom: 0.75rem;
}

.sidebar-group-label {
  padding: 0.75rem 0.875rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--sidebar-muted-foreground));
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4375rem 0.75rem;
  margin: 0.0625rem 0;
  border-radius: var(--radius);
  color: hsl(var(--sidebar-foreground));
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  position: relative;
  transition: background-color var(--transition-fast) ease, color var(--transition-fast) ease;
}

.sidebar-nav-item:hover {
  background-color: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
}

.sidebar-nav-item.active {
  background-color: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-primary-foreground));
  font-weight: 600;
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: -0.25rem;
  top: 0.375rem;
  bottom: 0.375rem;
  width: 2px;
  border-radius: 2px;
  background-color: hsl(var(--sidebar-primary));
}

.sidebar-nav-item:focus-visible {
  outline: 2px solid hsl(var(--sidebar-ring));
  outline-offset: -2px;
}

.sidebar-nav-item .icon {
  width: 1rem;
  height: 1rem;
  font-size: 0.9375rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-nav-item.active .icon {
  opacity: 1;
}

.sidebar-nav-item .badge {
  margin-left: auto;
}

/* Sidebar Submenu */
.sidebar-submenu {
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid hsl(var(--sidebar-border));
  margin-top: 0.125rem;
  margin-bottom: 0.25rem;
}

.sidebar-submenu .sidebar-nav-item {
  padding: 0.375rem 0.625rem;
  font-size: 0.78125rem;
}

/* Sidebar Toggle Button (Desktop) */
.sidebar-toggle {
  position: absolute;
  right: -0.75rem;
  top: 5rem;
  width: 1.5rem;
  height: 1.5rem;
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 9999px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
  z-index: 50;
  transition: all var(--transition-fast) ease;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
}

.sidebar-toggle:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--foreground));
}

/* Sidebar Icon */
.sidebar-icon {
  font-size: 1.125rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

/* Sidebar Search */
.sidebar-search {
  padding: 0.75rem;
  border-bottom: 1px solid hsl(var(--sidebar-border));
}

.sidebar-search-input {
  width: 100%;
  height: 2.25rem;
  padding-left: 2.25rem;
  padding-right: 2.25rem;
  font-size: 0.875rem;
  background-color: hsl(var(--accent));
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  transition: border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
}

.sidebar-search-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.sidebar-search-input::placeholder {
  color: hsl(var(--muted-foreground));
}

/* Sidebar Avatar */
.sidebar-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* Sidebar Logout */
.sidebar-logout-btn {
  padding: 0.5rem;
  border-radius: var(--radius);
  color: hsl(var(--muted-foreground));
  transition: all var(--transition-fast) ease;
}

.sidebar-logout-btn:hover {
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

/* Sidebar Accordion */
.accordion-item {
  position: relative;
}

.accordion-content {
  overflow: hidden;
  transition: max-height 0.2s ease-out;
  max-height: 0;
  will-change: max-height;
}

.accordion-chevron {
  font-size: 0.625rem;
  color: hsl(var(--muted-foreground));
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.accordion-item[data-state="open"] > .accordion-trigger .accordion-chevron {
  transform: rotate(180deg);
}

/* Sidebar Scroll Shadows */
.sidebar-content.has-scroll-top {
  box-shadow: inset 0 8px 6px -6px rgb(0 0 0 / 0.06);
}

.sidebar-content.has-scroll-bottom {
  box-shadow: inset 0 -8px 6px -6px rgb(0 0 0 / 0.06);
}

.sidebar-content.has-scroll-top.has-scroll-bottom {
  box-shadow: inset 0 8px 6px -6px rgb(0 0 0 / 0.06),
              inset 0 -8px 6px -6px rgb(0 0 0 / 0.06);
}

/* Sidebar Search Hidden */
.search-hidden {
  display: none !important;
}

/* Sidebar No Results */
.sidebar-no-results {
  padding: 2rem 1rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.sidebar-no-results i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
  opacity: 0.5;
}

.sidebar-no-results p {
  font-size: 0.8125rem;
}

/* Sidebar Mobile */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: var(--z-fixed);
    width: var(--sidebar-width);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    width: var(--sidebar-width);
  }
}

/* =================================================================
   15. HEADER
   ================================================================= */

.header {
  height: var(--header-height);
  background-color: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.breadcrumb-item {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-item:hover {
  color: hsl(var(--primary));
}

.breadcrumb-item.active {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.breadcrumb-separator {
  color: hsl(var(--muted-foreground));
}

/* =================================================================
   16. TOAST NOTIFICATIONS
   ================================================================= */

.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  min-width: 20rem;
  max-width: 28rem;
  animation: slideUp var(--transition-normal) ease;
}

.toast-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.toast-message {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
  color: hsl(var(--muted-foreground));
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.toast-success .toast-icon { color: hsl(160 84% 39%); }
.toast-warning .toast-icon { color: hsl(43 96% 56%); }
.toast-danger .toast-icon { color: hsl(0 84% 60%); }
.toast-info .toast-icon { color: hsl(217 91% 60%); }

/* =================================================================
   17. PAGINATION
   ================================================================= */

.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pagination-item:hover:not(.disabled):not(.active) {
  background-color: hsl(var(--accent));
}

.pagination-item.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.pagination-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =================================================================
   18. TABS
   ================================================================= */

.tabs {
  border-bottom: 1px solid hsl(var(--border));
}

.tabs-list {
  display: flex;
  gap: 0.5rem;
}

.tabs-trigger {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tabs-trigger:hover {
  color: hsl(var(--foreground));
}

.tabs-trigger.active {
  color: hsl(var(--primary));
  border-bottom-color: hsl(var(--primary));
}

.tabs-content {
  padding: 1.5rem 0;
}

/* =================================================================
   19. UTILITIES
   ================================================================= */

/* Screen Reader Only */
.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;
}

/* Animations */
.animate-fade-in {
  animation: fadeIn var(--transition-normal) ease-out;
}

.animate-slide-up {
  animation: slideUp var(--transition-normal) ease-out;
}

.animate-slide-down {
  animation: slideDown var(--transition-normal) ease-out;
}

.animate-scale-in {
  animation: scaleIn var(--transition-fast) ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Scrollbar Styling */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--muted-foreground) / 0.3) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.3);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.5);
}

/* Sidebar com scrollbar personalizada */
.sidebar.custom-scrollbar .sidebar-content {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--sidebar-border)) transparent;
}

.sidebar.custom-scrollbar .sidebar-content::-webkit-scrollbar {
  width: 5px;
}

.sidebar.custom-scrollbar .sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar.custom-scrollbar .sidebar-content::-webkit-scrollbar-thumb {
  background: hsl(var(--sidebar-foreground) / 0.2);
  border-radius: 3px;
}

.sidebar.custom-scrollbar .sidebar-content::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--sidebar-foreground) / 0.4);
}

/* =================================================================
   20. RESPONSIVE ADJUSTMENTS
   ================================================================= */

@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .modal {
    width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
  }
}

/* =================================================================
   21. CUSTOM SCROLLBAR
   ================================================================= */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: hsl(var(--muted) / 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.3);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.5);
  background-clip: content-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--muted-foreground) / 0.3) hsl(var(--muted) / 0.3);
}

/* Primary themed scrollbar */
.scrollbar-primary::-webkit-scrollbar-thumb {
  background: hsl(var(--primary) / 0.3);
}

.scrollbar-primary::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--primary) / 0.5);
}

.scrollbar-primary {
  scrollbar-color: hsl(var(--primary) / 0.3) hsl(var(--muted) / 0.3);
}

/* Hidden scrollbar but scrollable */
.scrollbar-hidden {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scrollbar-hidden::-webkit-scrollbar {
  display: none;
}

/* =================================================================
   22. ACCESSIBILITY BAR
   ================================================================= */

.accessibility-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background-color: hsl(var(--muted) / 0.3);
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.75rem;
}

.accessibility-bar button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.accessibility-bar button:hover {
  background-color: hsl(var(--accent));
  border-color: hsl(var(--primary) / 0.3);
}

.accessibility-bar button.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

/* Font Size Classes */
.font-size-normal {
  font-size: 100%;
}

.font-size-large {
  font-size: 112.5%;
}

.font-size-xlarge {
  font-size: 125%;
}

/* =================================================================
   24. PRINT STYLES
   ================================================================= */

@media print {
  .sidebar,
  .header,
  .skip-link,
  .btn,
  .modal-backdrop,
  .toast-container,
  .accessibility-bar,
  [vw] {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  .card {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
  }

  h1, h2, h3, h4, h5, h6 {
    break-after: avoid;
    color: black !important;
  }

  a {
    text-decoration: underline;
    color: black !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  .table {
    border-collapse: collapse;
  }

  .table th,
  .table td {
    border: 1px solid #ccc;
  }
}
