/* Shared module header. Keep avatar .topbar variants out of this scope. */
.app-shell .main-area > header.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  height: auto; min-height: 94px; gap: 16px 24px; padding: 18px 28px;
  background: #FFFFFF; border-bottom: 1px solid #DCE8E6;
  box-shadow: 0 2px 8px rgb(20 67 65 / 3%);
}
.app-shell header.topbar .topbar-title { flex: 1 1 230px; min-width: 0; }
.app-shell header.topbar .topbar-title h1 {
  font-size: 25px; line-height: 1.2; font-weight: 750; letter-spacing: -.6px;
  color: #153D41; white-space: normal; overflow-wrap: anywhere;
}
.app-shell header.topbar .topbar-title p { display: block; font-size: 12px; line-height: 1.5; margin: 5px 0 0; color: #526D71; white-space: normal; max-width: 60ch; }
.app-shell header.topbar .topbar-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  width: auto; max-width: 100%; height: auto; padding: 0; background: transparent;
  border: 0; box-shadow: none; flex-shrink: 1;
}
.app-shell header.topbar .topbar-filter {
  display: grid; gap: 1px; margin: 0; padding: 6px 11px;
  background: #F1F6F5; border: 1px solid #D4E2DF; border-radius: 10px;
  min-width: 0; cursor: pointer;
}
.app-shell header.topbar .topbar-filter > span { font-size: 10px; line-height: 1.2; font-weight: 600; letter-spacing: 0; text-transform: none; color: #57716D; }
.app-shell header.topbar .topbar-select {
  width: 100%; height: 25px; min-height: 25px; min-width: 0; max-width: 100%;
  padding: 0 24px 0 0; margin: 0; border: 0; border-radius: 3px;
  background-color: transparent; background-position: right 1px center;
  color: #193F43; font-size: 12px; font-weight: 600; box-shadow: none;
}
.app-shell header.topbar .topbar-filter-farm { width: 205px; }
.app-shell header.topbar :is(#farm-filter, #period-filter) {
  width: 100%; min-width: 0; padding-left: 0; padding-right: 22px;
  background-position: right 1px center; color: #193F43;
  grid-column: auto; grid-row: auto;
}
.app-shell header.topbar .topbar-filter-period { width: 148px; }
.app-shell header.topbar .topbar-filter:hover { border-color: #8CB4AB; }
.app-shell header.topbar .topbar-filter:focus-within { outline: 2px solid #238577; outline-offset: 2px; }
.app-shell header.topbar .topbar-select:focus { outline: none; box-shadow: none; }
.app-shell header.topbar .notification-button {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  width: auto; min-width: 44px; height: 48px; padding: 0 12px;
  border: 1px solid #D4E2DF; border-radius: 10px; background: #FFFFFF;
  color: #365C5B; font-size: 12px; box-shadow: none;
}
.app-shell header.topbar .notification-button.has-alerts { color: #86520A; background: #FFF7E8; border-color: #EFDBAF; }
.app-shell header.topbar .notification-label { display: inline; }
.app-shell header.topbar .notification-button .badge {
  position: static; display: inline-flex; align-items: center; justify-content: center;
  min-width: 21px; height: 21px; padding: 0 5px; margin: 0; border: 0;
  border-radius: 6px; background: #8B570B; color: #FFFFFF; font-size: 10px; line-height: 1;
}
.app-shell header.topbar .notification-button .badge:empty { display: none; }
.app-shell header.topbar .profile-menu-wrap { width: auto; min-width: 0; }
.app-shell header.topbar .profile-button {
  height: 48px; width: auto; max-width: 210px; padding: 4px 9px 4px 5px; gap: 9px;
  border: 1px solid #D4E2DF; border-radius: 10px; background: #FFFFFF; box-shadow: none;
}
.app-shell header.topbar .profile-avatar { width: 35px; height: 35px; min-height: 0; border-radius: 50%; box-shadow: none; }
/* Sem foto: a inicial aparece no menta da marca, não em cinza. */
.app-shell header.topbar .profile-avatar:not(:has(img)) { background: var(--brand-menta); color: var(--brand-menta-tinta); font-weight: 700; }
.app-shell header.topbar .profile-copy { display: block; min-width: 0; text-align: left; }
.app-shell header.topbar .profile-copy strong { max-width: 125px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: #193F43; }
.app-shell header.topbar .profile-copy small { display: block; font-size: 10px; line-height: 1.4; color: #617774; text-transform: none; letter-spacing: 0; }
.app-shell header.topbar :is(.profile-button, .notification-button):hover { border-color: #8CB4AB; background: #EDF5F2; }
.app-shell header.topbar button:focus-visible { outline: 2px solid #238577; outline-offset: 3px; }
/* Botão Alertas (03/11/2026): modelo do Uiverse (vinodjangid07), sino e seta, nas cores da paleta.
   O contador (.badge) continua sendo atualizado por notificationBadges.js. */
.app-shell header.topbar .notification-button {
  position: relative; justify-content: flex-start; gap: 10px; min-width: 150px; padding: 0 34px 0 15px;
  border: 0; background: var(--brand-petroleo); color: #FFFFFF; font-size: 13px; font-weight: 600; cursor: pointer; transition-duration: .2s;
}
.app-shell header.topbar .notification-button:hover { border: 0; background: var(--brand-petroleo-hover); }
.app-shell header.topbar .notification-button:active { transform: translate(1px, 1px); }
.app-shell header.topbar .notification-button.has-alerts { color: #FFFFFF; background: var(--brand-petroleo); border: 0; }
.app-shell header.topbar .notification-button.has-alerts:hover { background: var(--brand-petroleo-hover); }
.app-shell header.topbar .notification-bell { width: 13px; height: auto; flex: none; }
.app-shell header.topbar .notification-bell path { fill: #2BD48F; }
.app-shell header.topbar .notification-button.has-alerts .notification-bell path { fill: #F5B83D; }
.app-shell header.topbar .notification-button .badge { background: #F5B83D; color: #3A2600; }
.app-shell header.topbar .notification-arrow {
  position: absolute; top: 0; right: 0; width: 30px; height: 100%;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.app-shell header.topbar .notification-button:hover .notification-arrow { animation: notification-arrow-in .6s ease-out both; }
@keyframes notification-arrow-in { 0% { transform: translateX(-10px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .app-shell header.topbar .notification-button:hover .notification-arrow { animation: none; }
}
/* Fazenda, Período e perfil na mesma estética do botão Alertas (03/11/2026): fundo verde-petróleo,
   texto claro e a seta "›" que entra ao passar o mouse (virada para baixo nas listas). */
.app-shell header.topbar .topbar-filter {
  position: relative; height: 48px; align-content: center; padding: 6px 32px 6px 15px;
  border: 0; background: var(--brand-petroleo); transition-duration: .2s;
}
.app-shell header.topbar .topbar-filter:hover { border: 0; background: var(--brand-petroleo-hover); }
.app-shell header.topbar .topbar-filter:active { transform: translate(1px, 1px); }
.app-shell header.topbar .topbar-filter > span { color: var(--brand-menta-claro); }
.app-shell header.topbar .topbar-select,
.app-shell header.topbar :is(#farm-filter, #period-filter) {
  appearance: none; -webkit-appearance: none; background-image: none; padding-right: 0; color: #FFFFFF; cursor: pointer;
}
.app-shell header.topbar .topbar-select option { color: #14282B; background: #FFFFFF; }
.app-shell header.topbar .topbar-filter::after {
  content: "›"; position: absolute; top: 0; right: 0; width: 30px; height: 100%;
  display: flex; align-items: center; justify-content: center; font-size: 18px; color: #FFFFFF;
  transform: rotate(90deg); pointer-events: none;
}
.app-shell header.topbar .topbar-filter:hover::after { animation: topbar-arrow-down .6s ease-out both; }
@keyframes topbar-arrow-down { 0% { transform: rotate(90deg) translateX(-10px); opacity: 0; } 100% { transform: rotate(90deg) translateX(0); opacity: 1; } }
.app-shell header.topbar .profile-button { position: relative; padding-right: 32px; border: 0; background: var(--brand-petroleo); transition-duration: .2s; }
.app-shell header.topbar .profile-button:hover { border: 0; background: var(--brand-petroleo-hover); }
.app-shell header.topbar .profile-button:active { transform: translate(1px, 1px); }
.app-shell header.topbar .profile-copy strong { color: #FFFFFF; }
.app-shell header.topbar .profile-copy small { color: var(--brand-menta-claro); }
.app-shell header.topbar .profile-button::after {
  content: "›"; position: absolute; top: 0; right: 0; width: 30px; height: 100%; margin: 0;
  display: flex; align-items: center; justify-content: center; border: 0; font-size: 18px; color: #FFFFFF;
  transform: rotate(90deg);
}
.app-shell header.topbar .profile-button:hover::after { animation: topbar-arrow-down .6s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .app-shell header.topbar :is(.topbar-filter, .profile-button):hover::after { animation: none; }
}
@media (max-width: 1100px) {
  .app-shell .main-area > header.topbar { gap: 12px; padding: 16px 20px; }
  .app-shell header.topbar .topbar-actions { flex: 1 1 100%; }
  .app-shell header.topbar .topbar-filter-farm { flex: 1; }
}
@media (max-width: 600px) {
  .app-shell .main-area > header.topbar { padding: 14px 16px; }
  .app-shell header.topbar .topbar-title h1 { font-size: 22px; }
  .app-shell header.topbar .topbar-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; gap: 8px; }
  .app-shell header.topbar .topbar-filter-farm { grid-column: 1 / -1; width: auto; }
  .app-shell header.topbar .topbar-filter-period { grid-column: 1; width: auto; }
  .app-shell header.topbar .notification-button { grid-column: 2; grid-row: auto; height: 46px; min-width: 0; padding: 0 11px; }
  .app-shell header.topbar .notification-arrow { display: none; }
  .app-shell header.topbar .profile-menu-wrap { grid-column: 3; grid-row: auto; }
  .app-shell header.topbar .profile-button { width: 44px; height: 46px; padding: 4px; }
  .app-shell header.topbar .profile-copy,
  .app-shell header.topbar .profile-button::after { display: none; }
}
