/* ============================================================
   SEDUC - SISTEMA DE GESTÃO ESCOLAR
   DESIGN SYSTEM v1.0
   Design Premium - Glassmorphism, Inter Font, Micro-interações
   ============================================================ */

/* --- GOOGLE FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- CSS CUSTOM PROPERTIES (DESIGN TOKENS) --- */
:root {
  /* === PALETA DE CORES PRINCIPAL === */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  --primary-950: #172554;

  /* === CORES DE SUPORTE === */
  --success-50: #f0fdf4;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;

  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;

  --danger-50: #fef2f2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;

  --info-50: #eff6ff;
  --info-500: #3b82f6;
  --info-600: #2563eb;

  /* === NEUTRAS === */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #030712;

  /* === FUNDO / SUPERFÍCIE === */
  --bg-body: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-dark: rgba(15, 23, 42, 0.85);

  /* === TIPOGRAFIA === */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* === BORDAS E SOMBRAS === */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.08), 0 8px 10px rgba(0,0,0,0.04);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,0.12);
  --shadow-glass: 0 8px 32px rgba(0,0,0,0.08);

  /* === TRANSIÇÕES === */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* === LAYOUT === */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --content-max-width: 1400px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--bg-body);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  font-family: var(--font-sans);
  border: none;
  outline: none;
  background: none;
}

input, select, textarea {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  outline: none;
}

/* Scrollbar Customizada */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ============================================================
   TIPOGRAFIA
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--gray-900);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

.text-muted { color: var(--gray-500); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-center { text-align: center; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  border: 1.5px solid transparent;
}
.btn:active {
  transform: scale(0.97);
}
.btn--primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #fff;
  box-shadow: var(--shadow-sm), 0 0 0 0 rgba(37,99,235,0);
}
.btn--primary:hover {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
  box-shadow: var(--shadow-md), 0 0 0 4px rgba(37,99,235,0.2);
  transform: translateY(-1px);
}
.btn--secondary {
  background: var(--bg-surface);
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn--secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  box-shadow: var(--shadow-sm);
}
.btn--success {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
  color: #fff;
}
.btn--success:hover {
  box-shadow: 0 0 0 4px rgba(34,197,94,0.2);
  transform: translateY(-1px);
}
.btn--danger {
  background: linear-gradient(135deg, var(--danger-500), var(--danger-600));
  color: #fff;
}
.btn--danger:hover {
  box-shadow: 0 0 0 4px rgba(239,68,68,0.2);
  transform: translateY(-1px);
}
.btn--warning {
  background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
  color: #fff;
}
.btn--ghost {
  background: transparent;
  color: var(--gray-600);
}
.btn--ghost:hover {
  background: var(--gray-100);
}
.btn--outline {
  background: transparent;
  border-color: var(--primary-500);
  color: var(--primary-600);
}
.btn--outline:hover {
  background: var(--primary-50);
}
.btn--sm {
  padding: 0.375rem 0.75rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}
.btn--lg {
  padding: 0.875rem 1.75rem;
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}
.btn--xl {
  padding: 1rem 2.5rem;
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}
.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}
.btn--block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn--loading {
  color: transparent !important;
  pointer-events: none;
}
.btn--loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn--secondary.btn--loading::after {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--gray-600);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: all var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card--glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: var(--shadow-glass);
}
.card--stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}
.card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.card__icon--blue { background: var(--primary-100); color: var(--primary-600); }
.card__icon--green { background: var(--success-50); color: var(--success-600); }
.card__icon--yellow { background: var(--warning-50); color: var(--warning-600); }
.card__icon--red { background: var(--danger-50); color: var(--danger-600); }
.card__icon--purple { background: #f3e8ff; color: #9333ea; }
.card__stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}
.card__stat-label {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: 2px;
}

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}
.form-label--required::after {
  content: ' *';
  color: var(--danger-500);
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--gray-800);
  transition: all var(--transition-fast);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  outline: none;
}
.form-input::placeholder {
  color: var(--gray-400);
}
.form-input--error {
  border-color: var(--danger-500) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important;
}
.form-textarea {
  resize: vertical;
  min-height: 80px;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2rem;
}
.form-hint {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: 0.25rem;
}
.form-error {
  font-size: var(--text-xs);
  color: var(--danger-600);
  margin-top: 0.25rem;
  display: none;
}
.form-error--visible {
  display: block;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-600);
  cursor: pointer;
}

/* ============================================================
   TABELAS
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: var(--bg-surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
thead {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}
thead th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--gray-600);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
tbody tr {
  transition: background var(--transition-fast);
}
tbody tr:hover {
  background: var(--gray-50);
}
tbody tr:last-child td {
  border-bottom: none;
}
.table-actions {
  display: flex;
  gap: 0.375rem;
}
.table-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--gray-200);
  background: var(--gray-100);
}
.table-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}
.badge--success { background: var(--success-50); color: var(--success-700); }
.badge--warning { background: var(--warning-50); color: var(--warning-700); }
.badge--danger { background: var(--danger-50); color: var(--danger-700); }
.badge--info { background: var(--info-50); color: var(--info-600); }
.badge--neutral { background: var(--gray-100); color: var(--gray-600); }

/* ============================================================
   MODAL / OVERLAY
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}
.modal-overlay--active {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  transform: translateY(20px) scale(0.96);
  transition: all var(--transition-base);
}
.modal-overlay--active .modal {
  transform: translateY(0) scale(1);
}
.modal--lg { max-width: 800px; }
.modal--xl { max-width: 1100px; }
.modal--sm { max-width: 400px; }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 2;
}
.modal__header h3 {
  font-size: var(--text-lg);
  font-weight: 700;
}
.modal__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all var(--transition-fast);
  font-size: 1.2rem;
}
.modal__close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
.modal__body {
  padding: 1.5rem;
}
.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  position: sticky;
  bottom: 0;
  background: var(--bg-surface);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ============================================================
   ALERTAS / TOASTS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid;
  min-width: 300px;
  max-width: 440px;
  animation: toastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
  font-size: var(--text-sm);
  font-weight: 500;
}
.toast--success { border-left-color: var(--success-500); }
.toast--error { border-left-color: var(--danger-500); }
.toast--warning { border-left-color: var(--warning-500); }
.toast--info { border-left-color: var(--info-500); }
.toast--removing {
  animation: toastOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.toast__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.toast--success .toast__icon { color: var(--success-500); }
.toast--error .toast__icon { color: var(--danger-500); }
.toast--warning .toast__icon { color: var(--warning-500); }
.toast--info .toast__icon { color: var(--info-500); }

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
.skeleton--text {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
}
.skeleton--text:last-child { width: 60%; }
.skeleton--avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
}
.skeleton--card {
  height: 100px;
  width: 100%;
}
.skeleton--row {
  height: 40px;
  width: 100%;
  margin-bottom: 4px;
}

/* ============================================================
   SIDEBAR DASHBOARD LAYOUT
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width var(--transition-base), transform var(--transition-base);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar--collapsed {
  width: var(--sidebar-collapsed);
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  height: var(--header-height);
  flex-shrink: 0;
}
.sidebar__brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.sidebar__brand-text {
  font-weight: 700;
  font-size: var(--text-lg);
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition-base);
}
.sidebar--collapsed .sidebar__brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}
.sidebar__nav {
  flex: 1;
  padding: 0.75rem 0.75rem;
}
.sidebar__section-title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 0.75rem 0.75rem 0.5rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  transition: all var(--transition-base);
}
.sidebar--collapsed .sidebar__section-title {
  opacity: 0;
  height: 0;
  padding: 0;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.65);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  white-space: nowrap;
}
.sidebar__link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar__link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}
.sidebar__link--active {
  background: rgba(59,130,246,0.2);
  color: #fff;
  font-weight: 600;
}
.sidebar__link--active i {
  color: var(--primary-400);
}
.sidebar__user {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar__user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
  color: #fff;
}
.sidebar__user-info {
  overflow: hidden;
  white-space: nowrap;
}
.sidebar__user-name {
  font-size: var(--text-sm);
  font-weight: 600;
}
.sidebar__user-role {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 1rem;
}
.header__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header__toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  font-size: 1.3rem;
  transition: all var(--transition-fast);
}
.header__toggle:hover {
  background: var(--gray-100);
}
.header__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--gray-800);
}
.header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header__ano-letivo {
  padding: 0.35rem 0.75rem;
  background: var(--primary-50);
  color: var(--primary-700);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--primary-200);
  transition: all var(--transition-fast);
}
.header__ano-letivo:hover {
  background: var(--primary-100);
}
.header__notif {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--gray-600);
  transition: all var(--transition-fast);
}
.header__notif:hover {
  background: var(--gray-100);
}
.header__notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger-500);
  border-radius: var(--radius-full);
  border: 2px solid #fff;
}
.header__user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}
.header__user-btn:hover {
  background: var(--gray-100);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-content--expanded {
  margin-left: var(--sidebar-collapsed);
}
.main-content__inner {
  padding: 1.5rem;
  flex: 1;
}
.page-view {
  display: none;
}
.page-view--active {
  display: block;
  animation: fadeIn 0.35s ease;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}
.tab {
  padding: 0.6rem 1.2rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.tab:hover {
  color: var(--gray-700);
}
.tab--active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-600);
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* ============================================================
   SEARCH / FILTER BAR
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.toolbar__search {
  position: relative;
  flex: 1;
  max-width: 380px;
}
.toolbar__search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.95rem;
}
.toolbar__search input {
  width: 100%;
  padding: 0.6rem 0.875rem 0.6rem 2.5rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  background: var(--bg-surface);
  transition: all var(--transition-fast);
}
.toolbar__search input:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.toolbar__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-state__icon {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: 1rem;
}
.empty-state__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.375rem;
}
.empty-state__text {
  color: var(--gray-500);
  margin-bottom: 1.25rem;
}

/* ============================================================
   AVATAR COM INICIAIS
   ============================================================ */
.avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  color: #fff;
  flex-shrink: 0;
  background: var(--primary-500);
}
.avatar-circle--sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-circle--lg { width: 64px; height: 64px; font-size: var(--text-lg); }
.avatar-circle--xl { width: 96px; height: 96px; font-size: var(--text-2xl); }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
}
.progress__fill--success { background: linear-gradient(90deg, var(--success-500), var(--success-600)); }
.progress__fill--danger { background: linear-gradient(90deg, var(--danger-500), var(--danger-600)); }
.progress__fill--warning { background: linear-gradient(90deg, var(--warning-500), var(--warning-600)); }

/* ============================================================
   PAGE HEADER COM BREADCRUMB
   ============================================================ */
.page-header {
  margin-bottom: 1.5rem;
}
.page-header__title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--gray-900);
}
.page-header__subtitle {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: 0.125rem;
}

/* ============================================================
   GRID DE CARDS (2 colunas)
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.25rem;
}

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-600); }
.text-danger { color: var(--danger-600); }
.text-success { color: var(--success-600); }
.text-warning { color: var(--warning-600); }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   ANIMAÇÕES
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.92); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(40px) scale(0.92); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  .sidebar--mobile-open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
  }
  .sidebar__brand-text { opacity: 1 !important; width: auto !important; }
  .sidebar__section-title { opacity: 1 !important; height: auto !important; padding: 0.75rem 0.75rem 0.5rem !important; }
  .header__toggle { display: flex !important; }
  .grid-2 { grid-template-columns: 1fr; }
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
  }
  .mobile-overlay--active {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar__search { max-width: none; }
  .main-content__inner { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .toast-container { left: 1rem; right: 1rem; }
  .toast { min-width: 0; max-width: none; }
  .header { padding: 0 1rem; }
  .header__title { font-size: var(--text-base); }
}