:root {
  --azul: #2c5791;
  --vermelho: #CC4331;
  --bg: #F5F6FA;
  --txt: #2a2a2a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", Arial, sans-serif;
  background: var(--bg);
  color: var(--txt);
}

/* ====== HEADER / HERO ====== */
.hero {
  position: relative;
  background: linear-gradient(135deg, #0a192f 0%, #003366 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-height: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.05) 0%, transparent 20%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
}

.logo {
  height: 150px;
  width: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #f4f7fb;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.hero-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
}

.hero-title .school-name {
  display: block;
  margin-top: 6px;
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: 500;
  color: rgba(244, 247, 251, .92);
  letter-spacing: .3px;
}

.hero-subtitle {
  margin: 0;
  color: rgba(244, 247, 251, .9);
  font-weight: 500;
  letter-spacing: .2px;
  font-size: clamp(13px, 1.5vw, 15px);
}

/* O fantasma ocupa o mesmo espaço visual da logo (para o título ficar no centro) */
.ghost {
  display: none
}

/* ====== SECTION TÍTULO ====== */
section {
  padding: 20px 20px;
  text-align: center;
}

section h2 {
  font-size: clamp(28px, 3vw, 42px);
  /* aumenta de forma fluida */
  font-weight: 600;
  color: var(--txt);
  margin-bottom: 10px;
}


section p {
  font-size: clamp(16px, 1.4vw, 20px);
  color: #555;
  margin-bottom: 40px;
}

.divider {
  height: 2px;
  background: #cacbcc;
  max-width: 1200px;
  margin: 10px auto 26px;
  border-radius: 1px;
}

/* ====== GRID DE ÍCONES ====== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  /* 4 colunas */
  gap: clamp(20px, 3vw, 40px);
  /* espaçamento ajustado */
  justify-content: center;
  /* centraliza horizontalmente o grid */
  align-items: center;
  margin: clamp(32px, 5vw, 60px) auto;
  max-width: 1200px;
  /* largura ajustada para 4 colunas */
  text-align: center;
  padding: 0 16px;
}

.grid .tile:nth-child(9) {
  grid-column: 2;
}

.grid .tile:nth-child(10) {
  grid-column: 3;
}

/* === CADA TILE (CARTÃO DE SETOR) === */
.tile {
  background: #fff;
  border: 2px solid transparent;
  border-radius: 18px;
  width: min(218px, 100%);
  height: 218px;
  padding: 24px 18px;
  text-decoration: none;
  color: var(--txt);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s cubic-bezier(.2, .8, .2, 1), border-color .28s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  outline: none;
  animation: fadeUp .5s ease both;
  will-change: transform, box-shadow;
  backface-visibility: hidden;
}

/* ícone */
.tile .icon {
  width: 84px;
  height: auto;
  margin-bottom: 14px;
  transition: transform 0.25s ease;
}

/* Texto */
.tile .caption {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--azul);
  line-height: 1.3;
}

/* removed label overlay */

.tile::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(120deg, rgb(44 87 145 / 0) 0%, rgb(44 87 145 / 0.32) 45%, rgb(44 87 145 / 0) 90%);
  transform: translateX(-120%);
  pointer-events: none;
  transition: transform .9s ease;
}

/* === HOVER: efeito de botão moderno === */
.tile:hover {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #1a3e6e, var(--azul)) border-box;
  border: 2px solid transparent;
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 30px rgba(26, 62, 110, 0.22);
}

.tile:hover::before {
  transform: translateX(120%);
}

.tile:hover .icon {
  animation: pop .35s ease forwards;
}

.tile:hover .caption {
  color: var(--azul);
}

/* removed label overlay */

.tile:focus-visible {
  border-color: var(--vermelho);
  box-shadow: 0 0 0 4px rgba(204, 67, 49, .18), 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* Responsivo: volta para 1 coluna no celular */
@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* === EFEITO DE CLIQUE (pressão leve) === */
.tile:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheen {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(120%);
  }
}

@keyframes pop {
  0% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-3px) scale(1.1);
  }

  100% {
    transform: translateY(-2px) scale(1.08);
  }
}

.grid .tile:nth-child(1) {
  animation-delay: .05s;
}

.grid .tile:nth-child(2) {
  animation-delay: .12s;
}

.grid .tile:nth-child(3) {
  animation-delay: .19s;
}

.grid .tile:nth-child(4) {
  animation-delay: .26s;
}

.grid .tile:nth-child(5) {
  animation-delay: .33s;
}

.grid .tile:nth-child(6) {
  animation-delay: .40s;
}

.grid .tile:nth-child(7) {
  animation-delay: .47s;
}

.grid .tile:nth-child(8) {
  animation-delay: .54s;
}

.grid .tile:nth-child(9) {
  animation-delay: .61s;
}

.grid .tile:nth-child(10) {
  animation-delay: .68s;
}

@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 920px;
  }

  .grid .tile:nth-child(9),
  .grid .tile:nth-child(10) {
    grid-column: auto;
  }
}

/* === TABLET (768px) === */
@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column;
    padding: 20px 16px 24px;
    gap: 12px;
    text-align: center;
  }

  .logo {
    height: 80px;
  }

  .hero-text {
    align-items: center;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .grid .tile:nth-child(9),
  .grid .tile:nth-child(10) {
    grid-column: auto;
  }

  .tile {
    width: 100%;
    height: auto;
    min-height: 160px;
    padding: 20px 16px;
  }

  .tile .icon {
    width: 64px;
  }

  .tile .caption {
    font-size: 15px;
  }
}

/* === MOBILE (480px) === */
@media (max-width: 480px) {
  .hero-inner {
    padding: 14px 12px 18px;
  }

  .logo {
    height: 64px;
  }

  .hero-title {
    font-size: clamp(16px, 5vw, 20px);
  }

  .hero-title .school-name {
    font-size: clamp(12px, 3.5vw, 15px);
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 24px auto;
  }

  .tile {
    min-height: 140px;
    padding: 16px 12px;
    border-radius: 14px;
  }

  .tile .icon {
    width: 52px;
    margin-bottom: 10px;
  }

  .tile .caption {
    font-size: 13px;
  }

  section h2 {
    font-size: clamp(22px, 6vw, 32px);
  }

  section p {
    font-size: clamp(14px, 4vw, 16px);
    margin-bottom: 24px;
  }
}

/* Notificacao de novos chamados/atualizacoes */
.btn-notification {
  position: relative;
  overflow: visible !important;
}

.btn-notification.has-update::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 12px;
  height: 12px;
  background-color: var(--vermelho);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: pulse-dot 2s infinite;
  z-index: 10;
}

@keyframes pulse-dot {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* ====== USER PROFILE & AVATAR ====== */
.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.user-avatar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-btn:hover {
  border-color: #fff;
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder-icon {
  width: 24px;
  height: 24px;
  color: #fff;
  opacity: 0.8;
}

/* Menu Dropdown do Avatar */
.avatar-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  right: auto;
  width: min(340px, 88vw);
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 14px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  pointer-events: none;
}

.avatar-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* Abre ao passar o mouse/foco no avatar */
.user-avatar-wrapper:hover .avatar-dropdown-menu,
.user-avatar-wrapper:focus-within .avatar-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.avatar-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 0;
  width: 100%;
  height: 20px;
}

.avatar-dropdown-header {
  padding: 10px 12px 6px;
  font-size: 12px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.avatar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #334155;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  background: none;
  border: none;
  border-radius: 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.avatar-dropdown-item:hover {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  color: #1d4ed8;
  transform: translateX(2px);
}

.avatar-dropdown-item svg {
  color: #64748b;
  transition: color 0.2s;
  flex-shrink: 0;
}

.avatar-dropdown-item:hover svg {
  color: #1d4ed8;
}

.avatar-dropdown-item.danger-item:hover {
  background: #fef2f2;
  color: #dc2626;
}

.avatar-dropdown-item.danger-item:hover svg {
  color: #dc2626;
}

.avatar-dropdown-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #dbe5f2 12%, #dbe5f2 88%, transparent 100%);
  margin: 8px 2px;
}

/* Responsividade para o menu */
@media (max-width: 480px) {
  .user-name {
    display: none;
  }

  /* Em mobile, desativa abertura por hover — só por .show (clique via JS) */
  .user-avatar-wrapper:hover .avatar-dropdown-menu,
  .user-avatar-wrapper:focus-within .avatar-dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    pointer-events: none;
  }
}

/* ====== HAMBURGUER BUTTON ====== */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.hamburger-btn:hover  { background: rgba(255, 255, 255, 0.22); }
.hamburger-btn:active { background: rgba(255, 255, 255, 0.30); }

/* ====== SIDEBAR BACKDROP ====== */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 47, 0.55);
  backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.sidebar-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ====== MOBILE SIDEBAR ====== */
.mobile-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 88vw);
  background: #fff;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
  box-shadow: -8px 0 32px rgba(10, 25, 47, 0.18);
}

.mobile-sidebar.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.sidebar-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  background: linear-gradient(135deg, #0a192f 0%, #003366 100%);
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-avatar svg { width: 22px; height: 22px; color: #fff; opacity: 0.85; }
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user-name {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-close-btn:hover { background: rgba(255, 255, 255, 0.2); }

.sidebar-section-label {
  padding: 14px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  font-family: "Poppins", Arial, sans-serif;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-item:hover        { background: #f1f5f9; }
.sidebar-item:active       { background: #e2e8f0; }
.sidebar-item svg          { color: #64748b; flex-shrink: 0; }
.sidebar-item:hover svg    { color: #1d4ed8; }
.sidebar-item.danger       { color: #dc2626; }
.sidebar-item.danger svg   { color: #dc2626; }
.sidebar-item.danger:hover { background: #fef2f2; }

.sidebar-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 0;
}

/* ====== MOBILE HEADER COMPACTO (≤768px) ====== */
@media (max-width: 768px) {
  /* Mostrar hamburguer */
  .hamburger-btn { display: flex; }

  /* Ocultar avatar e saudação — sidebar assume o controle */
  .user-avatar-wrapper,
  .user-greeting { display: none !important; }

  /* Barra compacta linha única */
  .hero-inner {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 16px !important;
    min-height: 0 !important;
  }

  /* Título e badge somem no mobile */
  .hero-text { display: none !important; }

  /* Logo proporcional */
  .hero-left .logo { height: 48px !important; }

  /* hero-right só contém o hamburguer */
  .hero-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: auto !important;
    background: none !important;
    border: none !important;
    flex-direction: row !important;
  }

  .user-profile-menu {
    gap: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-width: unset !important;
    width: auto !important;
    margin-top: 0 !important;
  }
}

