/* GEGRAESP R136 — EVOLUÇÃO LIMPA R5
   Ajustes: header em linha única, badge sincronizado, origem dos alertas.
   Responsividade da R4 preservada. */

/* ===== CABEÇALHO: PERFIL -> SINO -> SAIR, SEM QUEBRA ===== */

.profile-badge{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex-wrap:nowrap!important;
  gap:7px!important;
  min-width:0!important;
  white-space:nowrap!important;
}

.profile-badge #profileLabel{
  min-width:0!important;
  max-width:clamp(76px,24vw,250px)!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  flex:0 1 auto!important;
}

.profile-badge #logoutBtn{
  flex:0 0 auto!important;
}

#gegraespNotificationBellR5.gegraesp-r136-r5-bell{
  position:relative!important;
  inset:auto!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 auto!important;
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  margin:0!important;
  padding:0!important;
  border:1px solid rgba(15,73,87,.16)!important;
  border-radius:50%!important;
  background:#fff!important;
  color:#174f5c!important;
  box-shadow:none!important;
  cursor:pointer!important;
  transform:none!important;
  vertical-align:middle!important;
  z-index:auto!important;
}

#gegraespNotificationBellR5.gegraesp-r136-r5-bell:active{
  transform:scale(.97)!important;
}

.gegraesp-r136-r5-badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:19px;
  height:19px;
  padding:0 4px;
  border:2px solid #fff;
  border-radius:999px;
  background:#b42318;
  color:#fff;
  font-size:10px;
  font-weight:900;
  line-height:15px;
  text-align:center;
}

/* ===== CENTRAL ===== */

.gegraesp-r136-r5-drawer[hidden]{display:none!important;}
.gegraesp-r136-r5-drawer{position:fixed;inset:0;z-index:2147483000;}
.gegraesp-r136-r5-backdrop{position:absolute;inset:0;background:rgba(10,23,29,.42);backdrop-filter:blur(1px);}
.gegraesp-r136-r5-panel{position:absolute;top:0;right:0;width:min(560px,100vw);height:100%;overflow:auto;background:#f8fbfb;box-shadow:-12px 0 34px rgba(0,0,0,.20);padding:18px;}
.gegraesp-r136-r5-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px;}
.gegraesp-r136-r5-panel-head h2{margin:0;color:#18343e;font-size:21px;line-height:1.2;}
.gegraesp-r136-r5-meta{margin:5px 0 0;color:#617177;font-size:12px;}
.gegraesp-r136-r5-close{flex:0 0 auto;width:40px;height:40px;border:0;border-radius:50%;background:#eaf1f2;color:#18343e;font-size:27px;line-height:1;cursor:pointer;}
.gegraesp-r136-r5-filter-block{margin:0 0 12px;}
.gegraesp-r136-r5-filter-title{display:block;margin:0 0 6px 2px;color:#607076;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;}
.gegraesp-r136-r5-filter-row{display:flex;flex-wrap:wrap;gap:7px;}

.gegraesp-r136-r5-chip{
  display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:7px 11px;
  border:1px solid #d8e3e5;border-radius:999px;background:#fff;color:#29434a;
  font:inherit;font-size:12px;font-weight:750;cursor:pointer;
}
.gegraesp-r136-r5-chip b{min-width:20px;padding:2px 6px;border-radius:999px;background:#edf3f4;color:#52656b;font-size:10px;text-align:center;}
.gegraesp-r136-r5-chip.is-active{border-color:#185e66;background:#185e66;color:#fff;}
.gegraesp-r136-r5-chip.is-active b{background:rgba(255,255,255,.20);color:#fff;}
.gegraesp-r136-r5-chip.tone-expired:not(.is-active){border-color:#f0cbc7;background:#fff8f7;color:#8f261e;}
.gegraesp-r136-r5-chip.tone-due:not(.is-active){border-color:#ead8a7;background:#fffaf0;color:#7a5800;}

.gegraesp-r136-r5-body{display:grid;gap:10px;margin-top:16px;}
.gegraesp-r136-r5-alert{
  border:1px solid #dce6e8;border-left:5px solid #d49a00;border-radius:13px;
  background:#fff;padding:12px 13px;box-shadow:0 2px 8px rgba(20,52,62,.04);
}
.gegraesp-r136-r5-alert[data-status="expired"]{border-left-color:#b42318;}
.gegraesp-r136-r5-alert.origin-internal{background:linear-gradient(180deg,#ffffff,#f8fbff);}

.gegraesp-r136-r5-alert-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px;}
.gegraesp-r136-r5-alert-head strong{display:block;color:#1e3037;font-size:13px;}
.gegraesp-r136-r5-alert-head small{display:block;margin-top:3px;color:#66767b;font-size:11px;}
.gegraesp-r136-r5-alert-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;}

.gegraesp-r136-r5-origin{
  flex:0 0 auto;padding:5px 8px;border-radius:999px;font-size:10px;font-weight:850;
}
.gegraesp-r136-r5-origin[data-origin="internal"]{background:#e9f0ff;color:#33528d;}
.gegraesp-r136-r5-origin[data-origin="anac"]{background:#e8f5f0;color:#176448;}

.gegraesp-r136-r5-status{
  flex:0 0 auto;padding:5px 8px;border-radius:999px;background:#fff4d7;color:#795500;font-size:10px;font-weight:900;
}
.gegraesp-r136-r5-status[data-status="expired"]{background:#ffebe8;color:#8f261e;}

.gegraesp-r136-r5-alert-grid{
  display:grid;grid-template-columns:minmax(0,1.5fr) minmax(120px,.8fr);
  gap:6px 14px;color:#44565c;font-size:12px;
}
.gegraesp-r136-r5-empty{padding:24px 14px;border:1px dashed #c8d6d9;border-radius:13px;background:#fff;color:#65757a;text-align:center;}
.gegraesp-r136-r5-open{overflow:hidden!important;}

/* ===== RESPONSIVIDADE R4 PRESERVADA / CSS-ONLY ===== */

@media (max-width:560px){
  #loginScreen.login-screen{
    height:auto!important;
    min-height:100vh!important;
    min-height:100dvh!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }

  #loginScreen .login-card{
    width:100%!important;
    height:auto!important;
    min-height:100vh!important;
    min-height:100dvh!important;
    max-height:none!important;
    overflow:visible!important;
  }

  #loginScreen .login-hero{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }

  #loginScreen .aircraft-showcase-f361{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    gap:12px!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }

  #loginScreen .aircraft-card-f361{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
  }

  #loginScreen .aircraft-photo-f361{
    width:100%!important;
    min-width:0!important;
    min-height:clamp(130px,29vh,220px)!important;
    height:clamp(130px,29vh,220px)!important;
    overflow:hidden!important;
  }

  #loginScreen .aircraft-photo-f361 img{
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
  }

  #loginScreen .login-actions,
  #loginScreen .login-actions-f361{
    margin-top:12px!important;
    flex:0 0 auto!important;
  }

  .profile-badge{
    gap:5px!important;
    max-width:100%!important;
  }

  .profile-badge #profileLabel{
    max-width:74px!important;
    font-size:10px!important;
    padding-left:6px!important;
    padding-right:6px!important;
  }

  #gegraespNotificationBellR5.gegraesp-r136-r5-bell{
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
  }

  .profile-badge #logoutBtn{
    padding-left:10px!important;
    padding-right:10px!important;
  }

  .gegraesp-r136-r5-panel{
    width:100vw;
    padding:14px;
  }

  .gegraesp-r136-r5-alert-grid{
    grid-template-columns:1fr;
  }
}

@media (min-width:561px){
  #loginScreen .aircraft-showcase-f361{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
    width:100%!important;
    min-height:0!important;
  }

  #loginScreen .aircraft-card-f361{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
}
