:root{
  /* Paleta principal — Ativa Mente */
  --bg-app: #AEE4F8;        /* fundo da aplicação */
  --text-primary: #005A9C;  /* texto principal / links */
  --header: #F7941D;        /* destaque */
  --accent: #8DC63F;        /* botões de ação */
  --footer: #A77DC2;        /* rodapé */
  --white: #FFFFFF;         /* branco */
  --muted: #6c757d;         /* textos secundários */
  --danger: #C0392B;        /* exclusão / erro */
  --card-bg: #ffffff;       /* cards */
  --radius: 8px;            /* borda padrão */
  --gap: 12px;              /* espaçamento padrão */
  --shadow: 0 8px 24px rgba(0,0,0,0.08);
  --font-sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial;
  --transition: all 0.3s ease;
}

/* ============================================================
   RESET E CONFIGURAÇÕES BASE
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* ============================================================
   SIDEBAR LATERAL
   ============================================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 220px;
  background: linear-gradient(180deg, var(--white), #f7f9fb);
  border-right: 1px solid rgba(0,0,0,0.04);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  z-index: 1000;
  transition: var(--transition);
}

.logo-sidebar {
  height: 48px;
  display: block;
  margin-bottom: 8px;
  object-fit: contain;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav a {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: 6px;
  transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.ativo {
  background: rgba(5,90,156,0.06);
  font-weight: 500;
}

.sidebar-bottom {
  display: flex;
  gap: 12px;
}

.sidebar-bottom a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  cursor: pointer;
}

.sidebar-bottom a:hover {
  background: rgba(5,90,156,0.1);
}

/* ============================================================
   MAIN WRAP E LAYOUT PRINCIPAL
   ============================================================ */
.main-wrap {
  margin-left: 220px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

/* ============================================================
   TOPBAR (CABEÇALHO)
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--card-bg);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title .subtitle {
  margin: 4px 0 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn-primary {
  background: var(--text-primary);
  color: var(--white);
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  min-height: 44px;
  transition: var(--transition);
  font-size: 0.95rem;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-search {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  min-height: 44px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-search:hover {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.12);
}

.botao {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  transition: var(--transition);
  font-size: 0.95rem;
}

.botao:hover {
  opacity: 0.9;
}

.botao:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.botaoExcluir {
  background: var(--danger);
  color: var(--white);
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  transition: var(--transition);
  font-size: 0.95rem;
}

.botaoExcluir:hover {
  opacity: 0.9;
}

/* ============================================================
   ÁREA DE CONTEÚDO
   ============================================================ */
.content {
  padding: 24px;
  background: transparent;
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.panel {
  background: var(--card-bg);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.panel:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

.panel h2 {
  margin: 0 0 16px 0;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.panel h3 {
  margin: 0 0 12px 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================================
   GRID DE MÉTRICAS (TILES)
   ============================================================ */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px;
}

.tile {
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  padding: 20px;
  border-radius: var(--radius);
  border-left: 4px solid var(--text-primary);
  text-align: center;
  transition: var(--transition);
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.tile-title {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.tile-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================================
   GRID DO DASHBOARD
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

.card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-left {
  grid-column: 1;
  max-height: 70vh;
}

.panel-right {
  grid-column: 2;
}

/* ============================================================
   FORMULÁRIOS E INPUTS
   ============================================================ */
.divInputs {
  display: flex;
  flex-flow: row wrap;
  gap: 10px;
}

.divInputs input,
.divInputs textarea,
.divInputs select {
  padding: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  min-height: 44px;
  font-size: 0.95rem;
  box-sizing: border-box;
  font-family: var(--font-sans);
  transition: var(--transition);
}

.divInputs input:focus,
.divInputs textarea:focus,
.divInputs select:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(0,90,156,0.1);
}

.divInputs input[type="date"] {
  padding: 8px;
}

.divInputs textarea {
  resize: vertical;
  min-height: 100px;
}

.divInputs label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}

/* ============================================================
   LISTA DE ALUNOS
   ============================================================ */
.lista-alunos {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lista-alunos li {
  padding: 12px;
  border-radius: 6px;
  background: #fbfdff;
  border: 1px solid rgba(0,0,0,0.04);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  transition: var(--transition);
}

.lista-alunos li:hover {
  background: #f0f4f8;
  border-color: rgba(0,0,0,0.08);
}

.lista-alunos li .info {
  flex: 1;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-primary);
  min-width: 200px;
}

.lista-alunos li .acoes {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  z-index: 2000;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 720px;
  max-width: 95%;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card h3 {
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-wrap input {
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 6px;
  min-height: 44px;
  font-size: 0.95rem;
  transition: var(--transition);
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(0,90,156,0.1);
}

.search-wrap {
  position: relative;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  max-height: 340px;
  overflow-y: auto;
  z-index: 50;
  padding: 8px 0;
}

.search-category {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.search-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: background 0.2s ease;
}

.search-item:hover {
  background: rgba(5,90,156,0.08);
}

.search-no-results,
.search-error {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ============================================================
   MENU TOGGLE E OVERLAY
   ============================================================ */
.menu-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  min-height: 40px;
  transition: var(--transition);
}

.menu-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0;
  background: var(--text-primary);
  transition: var(--transition);
}

.menu-toggle:hover {
  opacity: 0.7;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 999;
}

.overlay.ativo {
  display: block;
}

.sidebar.aberta {
  left: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.page-footer {
  margin-top: 24px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(0,0,0,0.04);
}

/* ============================================================
   BANNER
   ============================================================ */
.banner {
  background: linear-gradient(135deg, var(--text-primary) 0%, #0078cc 100%);
  color: var(--white);
  padding: 24px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.banner.small {
  padding: 16px 20px;
}

.banner-texto h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.banner-texto p {
  margin: 6px 0 0 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

/* ============================================================
   ACESSIBILIDADE E TOUCH
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="search"],
select,
textarea {
  font-size: 16px; /* Prevent zoom on iOS */
  -webkit-appearance: none;
  appearance: none;
}

button,
.btn-primary,
.botao,
.botaoExcluir,
.btn-search {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* Remove default styling for select/option */
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23005A9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 36px;
}

/* ============================================================
   RESPONSIVE - MOBILE (≤480px)
   ============================================================ */
@media (max-width: 480px) {
  .sidebar {
    width: 180px;
    padding: 15px;
    left: -180px;
  }

  .main-wrap {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .topbar {
    padding: 12px;
    gap: 8px;
  }

  .topbar-left {
    gap: 8px;
  }

  .topbar-title h1 {
    font-size: 1rem;
  }

  .topbar-title .subtitle {
    font-size: 0.75rem;
  }

  .topbar-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .search-wrap {
    width: 100%;
    flex-direction: column;
  }

  .search-wrap input {
    width: 100%;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  .btn-search {
    width: 100%;
    justify-content: center;
  }

  .content {
    padding: 12px;
    gap: 12px;
  }

  .panel {
    padding: 12px;
  }

  .metrics {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tile {
    padding: 16px;
  }

  .tile-value {
    font-size: 1.8rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .panel-left,
  .panel-right {
    grid-column: auto;
  }

  .panel-left {
  /* grid-column: 1; */
  max-height: 50vh;
  max-width: 95vw;
}

  .divInputs {
    flex-direction: column;
  }

  .divInputs input,
  .divInputs textarea,
  .divInputs select {
    width: 100%;
  }

  .divInputs input[type="checkbox"] {
    width: auto;
  }

  .modal-card {
    width: 95%;
    padding: 16px;
  }

  .lista-alunos li {
    flex-direction: column;
    align-items: flex-start;
  }

  .lista-alunos li .acoes {
    width: 100%;
  }

  .lista-alunos li .acoes button {
    flex: 1;
  }

  .banner {
    padding: 16px 12px;
  }

  .banner-texto h2 {
    font-size: 1.2rem;
  }

  .banner-texto p {
    font-size: 0.85rem;
  }




}


/* ============================================================
   RESPONSIVE - TABLET (481px - 768px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 768px) {
  .sidebar {
    width: 200px;
    padding: 15px;
    left: -200px;
  }

  .main-wrap {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .topbar {
    padding: 14px;
    gap: 10px;
  }

  .topbar-title h1 {
    font-size: 1.1rem;
  }

  .topbar-title .subtitle {
    font-size: 0.8rem;
  }

  .topbar-actions {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .search-wrap {
    width: 100%;
    flex-direction: column;
  }

  .search-wrap input {
    width: 100%;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .content {
    padding: 16px;
    gap: 14px;
  }

  .panel {
    padding: 14px;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .panel-left,
  .panel-right {
    grid-column: auto;
  }

  .divInputs {
    flex-direction: column;
  }

  .divInputs input,
  .divInputs textarea,
  .divInputs select {
    width: 100%;
  }

  .modal-card {
    width: 90%;
    padding: 18px;
  }

  .lista-alunos li {
    flex-direction: column;
    align-items: flex-start;
  }

  .lista-alunos li .acoes {
    width: 100%;
    flex-direction: row;
  }

  .lista-alunos li .acoes button {
    flex: 1;
  }
}

/* ============================================================
   RESPONSIVE - DESKTOP (≥769px)
   ============================================================ */
@media (min-width: 769px) {
  .sidebar {
    width: 220px;
    left: 0 !important;
  }

  .main-wrap {
    margin-left: 220px;
  }

  .menu-toggle {
    display: none !important;
  }

  .overlay {
    display: none !important;
  }

  .topbar {
    padding: 16px 24px;
  }

  .topbar-title h1 {
    font-size: 1.25rem;
  }

  .topbar-actions {
    flex-direction: row;
    width: auto;
    gap: 12px;
  }

  .search-wrap {
    width: auto;
    flex-direction: row;
  }

  .search-wrap input {
    min-width: 250px;
  }

  .content {
    padding: 24px;
  }

  .metrics {
    grid-template-columns: repeat(4, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 2fr 1fr;
  }

  .divInputs input,
  .divInputs textarea,
  .divInputs select {
    width: calc(50% - 5px);
  }

  .divInputs textarea {
    width: 100%;
  }

  .modal-card {
    width: 720px;
  }
}

/* Mobile: ≤480px */
@media (max-width: 480px){
  .sidebar {
    width: 180px;
    padding: 15px;
    left: -180px;
    transition: left 0.3s ease;
  }
  
  .sidebar.aberta {
    left: 0;
  }
  
  .main-wrap { 
    margin-left: 0;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .topbar {
    padding: 12px;
    gap: 10px;
  }
  
  .topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .topbar-title h1 {
    font-size: 1.2rem;
  }
  
  .topbar-title .subtitle {
    font-size: 0.8rem;
  }
  
  .topbar-actions {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  
  .search-wrap {
    width: 100%;
    flex-direction: column;
  }
  
  .search-wrap input {
    width: 100%;
  }
  
  .btn-primary {
    width: 100%;
    justify-content: center;
  }
  
  .content {
    padding: 12px;
  }
  
  .panel {
    padding: 12px;
  }
  
  .divInputs input, .divInputs textarea, .divInputs select {
    width: 100% !important;
  }
  
  .modal-card {
    width: 95%;
    padding: 15px;
  }
  
  .lista-alunos li {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .lista-alunos li .acoes {
    width: 100%;
  }
}

/* Tablet: 481px - 768px */
@media (min-width: 481px) and (max-width: 768px){
  .sidebar {
    width: 200px;
    padding: 15px;
    left: -200px;
    transition: left 0.3s ease;
  }
  
  .sidebar.aberta {
    left: 0;
  }
  
  .main-wrap { 
    margin-left: 0;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .topbar {
    padding: 14px;
    gap: 10px;
  }
  
  .topbar-title h1 {
    font-size: 1.15rem;
  }
  
  .topbar-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .search-wrap input {
    width: 100%;
  }
  
  .btn-primary {
    width: 100%;
    justify-content: center;
  }
  
  .content {
    padding: 16px;
  }
  
  .divInputs input, .divInputs textarea, .divInputs select {
    width: 100% !important;
  }
  
  .modal-card {
    width: 95%;
  }
  
  .lista-alunos li {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Desktop: ≥769px */
@media (min-width: 769px){
  .sidebar {
    width: 220px;
    left: 0 !important;
  }
  
  .main-wrap {
    margin-left: 220px;
  }
  
  .menu-toggle {
    display: none;
  }
  
  .overlay {
    display: none !important;
  }
  
  .topbar {
    padding: 16px 24px;
  }
  
  .topbar-actions {
    flex-direction: row;
  }
  
  .search-wrap input {
    min-width: 200px;
  }
  
  .content {
    padding: 24px;
  }
  
  .divInputs input, .divInputs textarea, .divInputs select {
    width: calc(50% - 10px);
  }
  
  .divInputs textarea {
    width: 100%;
  }
  
  .modal-card {
    width: 720px;
  }
}

/* ============================================================
   UNIVERSAL RESPONSIVE SYSTEM — ATIVAMENTE
   Mobile-First Approach para suporte profissional
   ============================================================ */

/* Banner styling for all pages */
.banner {
  background: linear-gradient(135deg, var(--text-primary) 0%, #0078cc 100%);
  color: var(--white);
  padding: 24px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.banner.small {
  padding: 16px 20px;
}

.banner-texto h2 {
  margin: 0;
  font-size: 1.5rem;
}

.banner-texto p {
  margin: 6px 0 0 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

/* Form improvements for touch devices */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
select,
textarea {
  font-size: 16px; /* Prevent zoom on iOS */
  -webkit-appearance: none;
  appearance: none;
}

/* Touch-friendly button sizes */
button, .btn-primary, .botao, .botaoExcluir {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
}

/* Button hover states for all sizes */
button:hover, .btn-primary:hover, .botao:hover, .botaoExcluir:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Mobile view improvements */
input, select, textarea, .divInputs input, .divInputs textarea, .divInputs select {
  max-width: 100%;
  box-sizing: border-box;
}

/* ============================================================
   1) MOBILE — até 480px
   ============================================================ */
@media (max-width: 480px) {

  /* Root variables for mobile */
  :root {
    --gap: 8px;
  }

  /* Sidebar: side drawer */
  .sidebar {
    position: fixed;
    left: -280px;
    width: 280px;
    transition: left 0.3s ease;
    z-index: 9999;
    height: 100vh;
    overflow-y: auto;
    top: 0;
  }

  .sidebar.aberta {
    left: 0;
  }

  .sidebar.open {
    left: 0;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 8px;
  }

  /* Overlay for sidebar */
  .overlay.ativo {
    display: block;
  }

  /* Main wrapper */
  .main-wrap {
    margin-left: 0 !important;
    width: 100%;
  }

  /* Topbar improvements */
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .topbar-title {
    width: 100%;
  }

  .topbar-title h1 {
    font-size: 1.3rem;
    margin: 0;
  }

  .topbar-title .subtitle {
    font-size: 0.8rem;
    margin-top: 4px;
  }

  .topbar-actions {
    width: 100%;
    gap: 8px;
    flex-direction: column;
  }

  .search-wrap {
    width: 100%;
  }

  .search-wrap input {
    width: 100%;
    min-width: auto;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }

  /* Content area */
  .content {
    padding: 10px;
    gap: 12px;
  }

  /* Panels */
  .panel {
    padding: 12px;
    border-radius: 8px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Cards and grids */
  .tile {
    padding: 12px;
  }

  .tile-value {
    font-size: 1.4rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .grid-profissionais {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .card-profissional {
    padding: 15px;
  }

  /* Forms */
  .divInputs {
    gap: 8px;
  }

  .divInputs input,
  .divInputs textarea,
  .divInputs select {
    width: 100% !important;
  }

  /* Modal improvements */
  .modal-card {
    width: 95% !important;
    max-height: 85vh;
    padding: 15px;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-actions button {
    width: 100%;
  }

  /* Tables */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Lists */
  .lista-alunos li,
  .lista-compromissos li {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Buttons in lists */
  .lista-alunos li .acoes,
  .comp-actions {
    width: 100%;
    flex-direction: row;
    gap: 6px;
  }

  .lista-alunos li .acoes button {
    flex: 1;
    min-width: 60px;
  }

  /* Financial cards */
  .cardDespesas,
  .cardReceitas {
    width: 100% !important;
  }

  .container {
    flex-direction: column;
    margin: 0 auto;
    padding: 15px;
  }

  /* Text adjustments */
  h1, h2, h3 {
    word-wrap: break-word;
  }

  .comp-title {
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
  }

  /* Banner */
  .banner-texto h2 {
    font-size: 1.2rem;
  }
}

/* ============================================================
   2) TABLET — 481px até 768px
   ============================================================ */
@media (min-width: 481px) and (max-width: 768px) {

  :root {
    --gap: 10px;
  }

  /* Sidebar behavior on tablet */
  .sidebar {
    position: fixed;
    left: -280px;
    width: 280px;
    transition: left 0.3s ease;
    z-index: 9999;
  }

  .sidebar.aberta {
    left: 0;
  }

  .menu-toggle {
    display: flex;
    width: 44px;
    height: 44px;
  }

  .main-wrap {
    margin-left: 0 !important;
    width: 100%;
  }

  /* Topbar */
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
  }

  .topbar-actions {
    width: 100%;
    flex-direction: column;
  }

  .search-wrap input {
    width: 100%;
  }

  .btn-primary {
    width: 100%;
  }

  /* Content */
  .content {
    padding: 15px;
  }

  .panel {
    padding: 14px;
  }

  /* Grids */
  .metrics {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .grid-profissionais {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Forms */
  .divInputs input,
  .divInputs textarea,
  .divInputs select {
    width: 100% !important;
  }

  /* Modal */
  .modal-card {
    width: 95% !important;
  }

  .modal-row {
    flex-direction: column;
  }

  .modal-row input,
  .modal-row select,
  .modal-row textarea {
    width: 100% !important;
  }

  /* Lists */
  .lista-alunos li,
  .lista-compromissos li {
    flex-direction: column;
    align-items: flex-start;
  }

  .lista-alunos li .acoes {
    width: 100%;
  }

  /* Tables */
  table.agenda {
    display: block;
    overflow-x: auto;
  }

  /* Financial */
  .cardDespesas,
  .cardReceitas {
    width: 100% !important;
  }

  .container {
    flex-direction: column;
  }

  form {
    flex-direction: column;
  }

  select, input {
    width: 100% !important;
  }
}

/* ============================================================
   3) SMALL LAPTOP — 769px até 1024px
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {

  .sidebar {
    width: 220px;
  }

  .main-wrap {
    margin-left: 220px;
  }

  .grid-profissionais {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .topbar {
    padding: 12px 16px;
  }
}

/* ============================================================
   4) DESKTOP — 1025px e acima
   ============================================================ */
@media (min-width: 1025px) {

  .sidebar {
    width: 220px;
    transform: translateX(0);
  }

  .main-wrap {
    margin-left: 220px;
  }

  .menu-toggle {
    display: none;
  }

  .overlay {
    display: none !important;
  }

  .metrics {
    grid-template-columns: repeat(4, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 2fr 1fr;
  }

  .grid-profissionais {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .divInputs input,
  .divInputs textarea,
  .divInputs select {
    width: calc(50% - 10px);
  }

  .divInputs textarea {
    width: 100%;
  }

  .modal-card {
    width: 720px;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
  }

  .topbar-actions {
    flex-direction: row;
  }

  .search-wrap input {
    min-width: 220px;
  }
}

/* ============================================================
   5) LARGE DESKTOP — 1400px e acima
   ============================================================ */
@media (min-width: 1400px) {
  .main-wrap {
    /* max-width: 1400px; */
    margin-left: 220px;
  }

  .content {
    padding: 24px;
  }

  .metrics {
    gap: 16px;
  }

  .grid-profissionais {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .sidebar,
  .topbar,
  .menu-toggle,
  .search-wrap,
  .btn-primary,
  .page-footer {
    display: none !important;
  }

  .main-wrap {
    margin-left: 0;
  }

  body {
    background: white;
  }
}

/* ===== SIDEBAR (DESKTOP) ===== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 220px;
  background: linear-gradient(180deg, var(--white), #f7f9fb);
  border-right: 1px solid rgba(0,0,0,0.04);
  padding: 20px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap: 12px;
  z-index: 1000;
  transition: transform .3s ease;
}

/* ===== MOBILE: sidebar recolhida ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.aberta {
    transform: translateX(0);
  }

  .menu-toggle {
    display: flex;
  }

  .main-wrap {
    margin-left: 0 !important;
  }
}

/* ===== OVERLAY ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 900;
}
.overlay.ativo {
  display: block;
}


