/* CEMIG nas Escolas - Estilos Corporativos */
:root {
  --cemig-blue: #003D8F;
  --cemig-blue-light: #0055C8;
  --cemig-blue-dark: #002670;
  --cemig-green: #00A651;
  --cemig-green-light: #00C061;
  --cemig-gray: #4A5568;
  --cemig-gray-light: #F7F8FA;
  --status-green: #22C55E;
  --status-yellow: #F59E0B;
  --status-red: #EF4444;
  --status-blue: #3B82F6;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #F0F4F8;
  color: #1A202C;
}

/* ── Login ── */
#login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--cemig-blue-dark) 0%, var(--cemig-blue) 50%, var(--cemig-blue-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .logo-circle {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--cemig-blue), var(--cemig-green));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 20px rgba(0,61,143,0.3);
}
.login-logo .logo-circle i { font-size: 2rem; color: white; }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--cemig-blue); }
.login-logo p { color: #718096; font-size: 0.85rem; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--cemig-gray); margin-bottom: 0.4rem; }
.form-group input {
  width: 100%; padding: 0.75rem 1rem;
  border: 2px solid #E2E8F0; border-radius: 10px;
  font-size: 0.95rem; transition: all 0.2s;
  outline: none; background: #fff; color: #1A202C;
}
.form-group input:focus { border-color: var(--cemig-blue); box-shadow: 0 0 0 3px rgba(0,61,143,0.1); }

.btn-login {
  width: 100%; padding: 0.85rem;
  background: linear-gradient(135deg, var(--cemig-blue), var(--cemig-blue-light));
  color: white; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: all 0.2s; box-shadow: 0 4px 15px rgba(0,61,143,0.3);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,61,143,0.4); }
.btn-login:active { transform: translateY(0); }

/* ── Layout Principal ── */
#main-app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px; min-height: 100vh;
  background: linear-gradient(180deg, var(--cemig-blue-dark) 0%, var(--cemig-blue) 100%);
  color: white; display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; z-index: 100;
  transition: transform 0.3s;
  box-shadow: 4px 0 20px rgba(0,0,0,0.2);
}
.sidebar-logo {
  padding: 1.5rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 0.75rem;
}
.sidebar-logo .logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--cemig-green), #00D46A);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo .logo-icon i { font-size: 1.2rem; color: white; }
.sidebar-logo .logo-text h2 { font-size: 0.95rem; font-weight: 800; line-height: 1.2; }
.sidebar-logo .logo-text span { font-size: 0.7rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; overflow-y: auto; }
.nav-section { margin-bottom: 1.5rem; }
.nav-section-title {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em;
  opacity: 0.5; padding: 0 0.75rem; margin-bottom: 0.5rem; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.75rem; border-radius: 10px;
  cursor: pointer; transition: all 0.2s; margin-bottom: 0.25rem;
  font-size: 0.9rem; font-weight: 500; color: rgba(255,255,255,0.75);
}
.nav-item:hover { background: rgba(255,255,255,0.12); color: white; }
.nav-item.active { background: rgba(255,255,255,0.2); color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.nav-item i { width: 20px; text-align: center; font-size: 1rem; }
.nav-item .badge {
  margin-left: auto; background: #EF4444;
  color: white; font-size: 0.65rem; font-weight: 700;
  padding: 0.1rem 0.5rem; border-radius: 20px; min-width: 20px; text-align: center;
}

.sidebar-user {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 0.75rem;
}
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cemig-green), var(--cemig-blue-light));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}
.user-info .user-name { font-size: 0.85rem; font-weight: 600; }
.user-info .user-role { font-size: 0.7rem; opacity: 0.6; }
.btn-logout { margin-left: auto; background: rgba(255,255,255,0.1); border: none; color: rgba(255,255,255,0.7); padding: 0.4rem 0.6rem; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.btn-logout:hover { background: rgba(239,68,68,0.3); color: white; }

/* Conteúdo principal */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  background: white;
  padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  position: sticky; top: 0; z-index: 50;
}
.top-bar h1 { font-size: 1.25rem; font-weight: 700; color: var(--cemig-blue); }
.top-bar-actions { display: flex; gap: 0.75rem; align-items: center; }

.page-content { padding: 1.5rem; flex: 1; }

/* ── Cards ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.stat-card {
  background: white; border-radius: 14px; padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid var(--cemig-blue);
  position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.stat-card::before {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: currentColor; opacity: 0.04;
}
.stat-card.green { border-color: var(--cemig-green); }
.stat-card.yellow { border-color: #F59E0B; }
.stat-card.red { border-color: #EF4444; }
.stat-card.purple { border-color: #8B5CF6; }

.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; }
.stat-icon.blue-bg { background: rgba(0,61,143,0.1); color: var(--cemig-blue); }
.stat-icon.green-bg { background: rgba(0,166,81,0.1); color: var(--cemig-green); }
.stat-icon.yellow-bg { background: rgba(245,158,11,0.1); color: #F59E0B; }
.stat-icon.red-bg { background: rgba(239,68,68,0.1); color: #EF4444; }
.stat-icon.purple-bg { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.stat-icon i { font-size: 1.1rem; }

.stat-value { font-size: 2rem; font-weight: 800; color: #1A202C; line-height: 1; }
.stat-label { font-size: 0.8rem; color: #718096; margin-top: 0.25rem; font-weight: 500; }

/* ── Gráficos ── */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.chart-card { background: white; border-radius: 14px; padding: 1.25rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.chart-card h3 { font-size: 1rem; font-weight: 700; color: var(--cemig-blue); margin-bottom: 1rem; }
.chart-container { position: relative; height: 250px; }

/* ── Calendário ── */
.calendar-header {
  background: white; border-radius: 14px; padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.calendar-nav { display: flex; align-items: center; gap: 1rem; }
.calendar-nav h2 { font-size: 1.2rem; font-weight: 700; color: var(--cemig-blue); min-width: 200px; text-align: center; }
.calendar-view-btns { display: flex; gap: 0.5rem; }
.btn-view {
  padding: 0.4rem 1rem; border: 2px solid #E2E8F0; background: white;
  border-radius: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 600;
  color: #718096; transition: all 0.2s;
}
.btn-view.active { border-color: var(--cemig-blue); background: var(--cemig-blue); color: white; }
.btn-view:hover:not(.active) { border-color: var(--cemig-blue); color: var(--cemig-blue); }

.calendar-grid { background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.calendar-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--cemig-blue);
}
.calendar-weekday { padding: 0.75rem; text-align: center; color: white; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-day {
  min-height: 120px; padding: 0.5rem; border-right: 1px solid #F0F4F8;
  border-bottom: 1px solid #F0F4F8; cursor: default; transition: background 0.2s;
}
.calendar-day:hover { background: #F7F8FA; }
.calendar-day.other-month .day-number { color: #CBD5E0; }
.calendar-day.today .day-number {
  background: var(--cemig-blue); color: white;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.day-number { font-size: 0.85rem; font-weight: 600; color: #4A5568; margin-bottom: 0.25rem; }
.day-events { display: flex; flex-direction: column; gap: 3px; }

.event-chip {
  font-size: 0.68rem; padding: 3px 6px; border-radius: 4px;
  font-weight: 600; white-space: normal; overflow: hidden;
  cursor: pointer; transition: opacity 0.2s; line-height: 1.3;
}
.event-chip:hover { opacity: 0.85; }
.event-chip.programado { background: #DCFCE7; color: #15803D; border-left: 3px solid #22C55E; }
.event-chip.em-andamento { background: #FEF9C3; color: #854D0E; border-left: 3px solid #F59E0B; }
.event-chip.atrasado { background: #FEE2E2; color: #991B1B; border-left: 3px solid #EF4444; }
.event-chip.finalizado { background: #DBEAFE; color: #1E40AF; border-left: 3px solid #3B82F6; }

/* ── Lista de Eventos ── */
.events-list { display: flex; flex-direction: column; gap: 0.75rem; }
.event-row {
  background: white; border-radius: 12px; padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); cursor: pointer;
  transition: all 0.2s; border-left: 4px solid #E2E8F0;
}
.event-row:hover { transform: translateX(3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.event-row.programado { border-color: #22C55E; }
.event-row.em-andamento { border-color: #F59E0B; }
.event-row.atrasado { border-color: #EF4444; }
.event-row.finalizado { border-color: #3B82F6; }

.status-badge {
  padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
  white-space: nowrap;
}
.status-badge.programado { background: #DCFCE7; color: #15803D; }
.status-badge.em-andamento { background: #FEF9C3; color: #854D0E; }
.status-badge.atrasado { background: #FEE2E2; color: #991B1B; }
.status-badge.finalizado { background: #DBEAFE; color: #1E40AF; }
.status-badge.cancelado { background: #F3F4F6; color: #6B7280; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem; backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal-card {
  background: white; border-radius: 16px; width: 100%; max-width: 760px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--cemig-blue-dark), var(--cemig-blue));
  color: white; border-radius: 16px 16px 0 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: rgba(255,255,255,0.15); border: none; color: white; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1rem; transition: all 0.2s; }
.modal-close:hover { background: rgba(255,255,255,0.3); }
.modal-body { padding: 1.5rem; background: #fff; }
.modal-footer {
  padding: 1rem 1.5rem; background: #F7F8FA;
  border-top: 1px solid #E2E8F0; border-radius: 0 0 16px 16px;
  display: flex; justify-content: flex-end; gap: 0.75rem;
}

/* ── Form helpers (usado no módulo Pesquisa) ── */
.form-label { display: block; font-size: 0.82rem; font-weight: 600; color: #4A5568; margin-bottom: 0.35rem; }
.form-label.required::after { content: ''; }
.required-mark { color: #EF4444; margin-left: 2px; }
.form-input, .form-select {
  width: 100%; padding: 0.65rem 0.875rem;
  border: 2px solid #E2E8F0; border-radius: 8px;
  font-size: 0.9rem; background: #fff; color: #1A202C;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--cemig-blue);
  box-shadow: 0 0 0 3px rgba(0,61,143,0.08);
}
.form-group { margin-bottom: 1rem; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-item { display: flex; flex-direction: column; gap: 0.25rem; }
.detail-label { font-size: 0.75rem; color: #9CA3AF; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.detail-value { font-size: 0.95rem; font-weight: 600; color: #1A202C; }

.quantities-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-top: 1rem; }
.qty-card { background: #F7F8FA; border-radius: 10px; padding: 0.75rem; text-align: center; }
.qty-number { font-size: 1.5rem; font-weight: 800; color: var(--cemig-blue); }
.qty-label { font-size: 0.7rem; color: #718096; }

/* ── Formulário ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }

.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field label { font-size: 0.8rem; font-weight: 600; color: #4A5568; }
.form-field input, .form-field select, .form-field textarea {
  padding: 0.65rem 0.875rem; border: 2px solid #E2E8F0; border-radius: 8px;
  font-size: 0.9rem; transition: all 0.2s; outline: none; background: white;
  color: #1A202C;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--cemig-blue); box-shadow: 0 0 0 3px rgba(0,61,143,0.08);
}
.form-field textarea { resize: vertical; min-height: 80px; }

/* ── Botões ── */
.btn {
  padding: 0.6rem 1.25rem; border-radius: 8px; border: none;
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-primary { background: var(--cemig-blue); color: white; }
.btn-primary:hover { background: var(--cemig-blue-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,61,143,0.3); }
.btn-success { background: var(--cemig-green); color: white; }
.btn-success:hover { background: #008A44; transform: translateY(-1px); }
.btn-danger { background: #EF4444; color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-outline { background: white; color: var(--cemig-blue); border: 2px solid var(--cemig-blue); }
.btn-outline:hover { background: var(--cemig-blue); color: white; }
.btn-ghost { background: #F3F4F6; color: #374151; border: none; }
.btn-ghost:hover { background: #E5E7EB; }
.btn-sm { padding: 0.4rem 0.875rem; font-size: 0.8rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; }

/* ── Filtros ── */
.filters-bar {
  background: white; border-radius: 12px; padding: 1rem 1.25rem;
  display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 1rem;
}
.filter-group { display: flex; flex-direction: column; gap: 0.35rem; }
.filter-group label { font-size: 0.75rem; font-weight: 600; color: #718096; }
.filter-group input, .filter-group select {
  padding: 0.5rem 0.75rem; border: 1.5px solid #E2E8F0; border-radius: 8px;
  font-size: 0.85rem; outline: none; transition: all 0.2s; min-width: 140px;
}
.filter-group input:focus, .filter-group select:focus { border-color: var(--cemig-blue); }

/* ── Alertas / Notificações ── */
.alert-panel { background: white; border-radius: 14px; padding: 1.25rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.alert-panel h3 { font-size: 0.95rem; font-weight: 700; color: #1A202C; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.alert-item { display: flex; gap: 0.75rem; padding: 0.75rem; border-radius: 10px; margin-bottom: 0.5rem; }
.alert-item.danger { background: #FEF2F2; border-left: 3px solid #EF4444; }
.alert-item.warning { background: #FFFBEB; border-left: 3px solid #F59E0B; }
.alert-item.info { background: #EFF6FF; border-left: 3px solid #3B82F6; }
.alert-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.alert-icon.danger { background: #FEE2E2; color: #EF4444; }
.alert-icon.warning { background: #FEF9C3; color: #F59E0B; }
.alert-icon.info { background: #DBEAFE; color: #3B82F6; }
.alert-text { flex: 1; }
.alert-title { font-size: 0.85rem; font-weight: 700; }
.alert-desc { font-size: 0.78rem; color: #718096; }

/* ── Tabela ── */
.table-container { background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.table-header { padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #F0F4F8; }
.table-header h3 { font-size: 1rem; font-weight: 700; color: var(--cemig-blue); }

table { width: 100%; border-collapse: collapse; }
thead { background: #F7F8FA; }
thead th { padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 700; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #E2E8F0; }
tbody tr { border-bottom: 1px solid #F7F8FA; transition: background 0.15s; cursor: pointer; }
tbody tr:hover { background: #F7FAFF; }
tbody td { padding: 0.875rem 1rem; font-size: 0.875rem; color: #374151; }
tbody tr:last-child { border-bottom: none; }

/* ── Performance ── */
.progress-bar { background: #E5E7EB; border-radius: 20px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 20px; transition: width 1s ease; background: linear-gradient(90deg, var(--cemig-blue), var(--cemig-green)); }

/* ── Relatórios ── */
.report-section { background: white; border-radius: 14px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 1.5rem; }
.report-section h3 { font-size: 1.1rem; font-weight: 700; color: var(--cemig-blue); margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 2px solid #F0F4F8; }
.report-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

/* ── Semana View ── */
.week-grid { display: grid; grid-template-columns: 60px repeat(7, 1fr); gap: 1px; background: #E2E8F0; border-radius: 12px; overflow: hidden; }
.week-header { background: var(--cemig-blue); color: white; padding: 0.75rem 0.5rem; text-align: center; font-size: 0.8rem; font-weight: 600; }
.week-header.time-col { background: var(--cemig-blue-dark); }
.week-cell { background: white; min-height: 80px; padding: 0.5rem; }
.week-cell.time-col { background: #F7F8FA; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #9CA3AF; font-weight: 600; }

/* ── Loading ── */
.spinner {
  width: 40px; height: 40px; border: 4px solid #E2E8F0;
  border-top-color: var(--cemig-blue); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen { display: flex; align-items: center; justify-content: center; min-height: 200px; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.875rem 1.25rem; border-radius: 10px; color: white;
  font-size: 0.875rem; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex; align-items: center; gap: 0.75rem; min-width: 280px;
  animation: slideIn 0.3s ease; max-width: 400px;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { background: #059669; }
.toast.error { background: #DC2626; }
.toast.warning { background: #D97706; }
.toast.info { background: var(--cemig-blue); }

/* ── Responsivo ── */
@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .quantities-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: 1fr; }
}

/* ── Usuários ── */
.user-card { background: white; border-radius: 12px; padding: 1.25rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; align-items: center; gap: 1rem; }
.user-card-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 800; flex-shrink: 0; }
.supervisor-bg { background: linear-gradient(135deg, var(--cemig-blue), var(--cemig-blue-light)); color: white; }
.visualizador-bg { background: linear-gradient(135deg, var(--cemig-green), #00D46A); color: white; }
.pesquisador-bg { background: linear-gradient(135deg, #7C3AED, #5B21B6); color: white; }
.user-card-info { flex: 1; }
.user-card-name { font-size: 0.95rem; font-weight: 700; }
.user-card-email { font-size: 0.8rem; color: #718096; }
.user-card-role { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.7rem; font-weight: 700; margin-top: 0.25rem; }
.supervisor-badge { background: #EFF6FF; color: var(--cemig-blue); }
.visualizador-badge { background: #F0FDF4; color: #15803D; }
.pesquisador-badge { background: #F5F3FF; color: #7C3AED; }

/* ── Semana ── */
.weekly-day-header { text-align: center; }
.weekly-day-name { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.weekly-day-num { font-size: 1.4rem; font-weight: 800; }
.weekly-day-num.today-num { color: var(--cemig-blue); }

/* ── Animações de entrada ── */
.fade-in { animation: fadeInUp 0.4s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── Indicador de conexão ── */
.connection-status { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.online { background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,0.2); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Scrollbar custom */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #A0AEC0; }

/* ── City Autocomplete ── */
.city-autocomplete { position: relative; }
.city-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: white; border: 2px solid var(--cemig-blue);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,61,143,0.15);
  z-index: 999; max-height: 240px; overflow-y: auto;
}
.city-option {
  padding: 0.6rem 0.875rem; cursor: pointer;
  transition: background 0.15s; border-bottom: 1px solid #F0F4F8;
  display: flex; justify-content: space-between; align-items: center;
}
.city-option:last-child { border-bottom: none; }
.city-option:hover { background: #EFF6FF; }

/* ── Drop Zone ── */
#drop-zone:hover { border-color: var(--cemig-blue); background: #EFF6FF !important; }
#drop-zone { transition: all 0.2s; }

/* ── Pesquisa de Clima ── */
.pesquisa-form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #E2E8F0;
}
.pesquisa-form-section:last-child { border-bottom: none; }

.radio-label {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 6px 14px; border: 1.5px solid #CBD5E0; border-radius: 8px;
  font-size: 0.875rem; transition: all 0.15s; user-select: none;
}
.radio-label:hover { border-color: #003D8F; background: #EBF8FF; }
.radio-label input { cursor: pointer; }
.radio-label.selected { background: #EBF8FF; border-color: #003D8F; font-weight: 700; }

.nota-label {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; padding: 8px 14px;
  border: 2px solid #E2E8F0; border-radius: 8px;
  font-size: 0.875rem; min-width: 48px; transition: all 0.15s;
}
.nota-label:hover { border-color: #003D8F; background: #EBF8FF; }
.nota-label.selected { background: #EBF8FF; border-color: #003D8F; }
.nota-label .nota-num { font-weight: 700; color: #003D8F; font-size: 1rem; }
.nota-label .nota-desc { font-size: 0.6rem; color: #718096; }

.av-label-otimo  { border-color: #00A65140 !important; color: #00A651; }
.av-label-bom    { border-color: #003D8F40 !important; color: #003D8F; }
.av-label-regular{ border-color: #F59E0B40 !important; color: #F59E0B; }
.av-label-ruim   { border-color: #EF444440 !important; color: #EF4444; }
.av-label-otimo.selected  { background: #F0FFF4 !important; border-color: #00A651 !important; }
.av-label-bom.selected    { background: #EBF8FF !important; border-color: #003D8F !important; }
.av-label-regular.selected{ background: #FFFBEB !important; border-color: #F59E0B !important; }
.av-label-ruim.selected   { background: #FEF2F2 !important; border-color: #EF4444 !important; }

.progress-bar-wrap {
  display: flex; align-items: center; gap: 8px;
}
.progress-bar-bg {
  flex: 1; height: 8px; background: #E2E8F0; border-radius: 4px; overflow: hidden;
}
.progress-bar-fill { height: 8px; border-radius: 4px; transition: width 0.5s ease; }
