:root {
  --portal-blue: #005a96;
  --portal-blue-dark: #004b82;
  --portal-blue-deep: #003f72;
}

/* Header logos: Softplan left, Obras.PE right */
.topbar::before,
.topbar::after {
  content: none !important;
  display: none !important;
}

.topbar-softplan {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: center;
  display: flex;
  align-items: center;
}

.topbar-softplan img {
  display: block;
  width: clamp(96px, 12vw, 154px);
  height: auto;
  max-height: 46px;
  object-fit: contain;
}

.topbar-obras {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  display: flex;
  align-items: center;
}

.topbar-obras img {
  display: block;
  width: clamp(72px, 8vw, 112px);
  height: auto;
  max-height: 58px;
  object-fit: contain;
}

.topbar .brand {
  gap: 0 !important;
}

.topbar .brand-mark,
.topbar .header-logo {
  display: none !important;
}

@media (max-width: 1180px) {
  .topbar-obras {
    display: none;
  }

  .topbar-softplan {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .topbar-softplan img {
    width: 108px;
    max-height: 36px;
  }

  .topbar .brand {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .profile {
    grid-row: 3 !important;
  }
}

body.locked .login-screen {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(340px, 680px);
  gap: 44px;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(circle at 72% 28%, rgba(246, 194, 47, .22), transparent 22%),
    linear-gradient(135deg, var(--portal-blue-deep), var(--portal-blue));
}

.login-screen::before {
  content: "Portal do Suporte Obras.PE\A Gerência Geral de Soluções Corporativas de Obras Públicas";
  white-space: pre-line;
  color: #fff;
  font-weight: 900;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.08;
  letter-spacing: -.02em;
  text-shadow: 0 8px 28px rgba(0, 35, 75, .22);
}

.login-card {
  position: relative;
  width: min(430px, 100%);
  padding: 28px 34px 34px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 26px 80px rgba(0, 30, 70, .34);
}

.login-card::before {
  content: none;
}

.login-mark {
  width: 220px !important;
  height: 156px !important;
  justify-self: center;
  border: 0 !important;
  border-radius: 0 !important;
  background: url('/logo-obras.svg?v=20260622-logo1') center / contain no-repeat !important;
  color: transparent !important;
}

.login-card h1 {
  font-size: 0;
  margin: -8px 0 4px;
}

.login-card h1::after {
  content: "Portal do Suporte Obras.PE";
  display: block;
  color: #003f72;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
}

.login-card p {
  color: #51657d;
  margin-bottom: 12px;
}

.login-card label,
.login-card .field label {
  color: #003f72;
  font-weight: 900;
}

.login-card input,
.login-card select {
  min-height: 44px;
  border-color: #bfd6ea;
  border-radius: 9px;
  background: #f8fbff;
}

.login-card input:focus,
.login-card select:focus {
  outline: 3px solid rgba(0, 90, 150, .16);
  border-color: #005a96;
}

.login-card button[type="submit"] {
  min-height: 46px;
  border-radius: 10px;
  background: #005a96;
  border-color: #005a96;
  box-shadow: 0 10px 24px rgba(0, 90, 150, .22);
}

.topbar {
  min-height: 104px !important;
  display: grid !important;
  grid-template-columns: minmax(190px, 280px) minmax(360px, 1fr) minmax(220px, 330px) !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  gap: 8px 18px !important;
  padding: 14px 28px 10px !important;
  background: #005a96 !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(0, 40, 80, .2) !important;
  overflow: visible !important;
}

.topbar::before {
  content: "GGOP\A Gerência Geral de Soluções\A Corporativas de Obras Públicas";
  white-space: pre-line;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  line-height: 1.18;
}

.topbar::after {
  content: "Secretaria da Controladoria\A Geral do Estado\A GOVERNO DE PERNAMBUCO";
  white-space: pre-line;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  text-align: right;
  color: #e8f5ff;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.08;
}

.topbar .brand {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  justify-content: center;
  min-width: 0;
  gap: 16px;
}

.topbar .brand-mark {
  width: 118px !important;
  height: 72px !important;
  flex: 0 0 118px;
  border: 0 !important;
  border-radius: 0 !important;
  background: url('/logo-obras.svg?v=20260622-logo1') center / contain no-repeat !important;
  color: transparent !important;
  box-shadow: none !important;
  font-size: 0 !important;
}

.topbar .brand strong {
  font-size: 0 !important;
  line-height: 1 !important;
  white-space: nowrap;
}

.topbar .brand strong::after {
  content: "Portal do Suporte Obras.PE";
  display: block;
  color: #fff;
  font-size: clamp(28px, 3.1vw, 44px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.02em;
}

.topbar .brand small,
.topbar .brand #apiStatus {
  color: #d8efff !important;
  font-size: 11px;
  margin-top: 6px;
  text-align: left;
}

.global-search {
  display: none !important;
}

.profile {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  justify-self: end !important;
  align-self: center !important;
  display: flex !important;
  gap: 8px !important;
  margin: 0 !important;
  position: static !important;
  transform: none !important;
  z-index: 1 !important;
}

.profile select#role,
.profile #role {
  height: 34px !important;
  min-width: 132px !important;
  background: rgba(255,255,255,.16) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.35) !important;
}

.profile select#role option,
.profile #role option {
  color: #0b2341;
  background: #fff;
}

#profileAvatar {
  width: 34px !important;
  height: 34px !important;
}

#logoutBtn,
.profile-tools button {
  height: 34px !important;
  background: #fff !important;
  color: #005a96 !important;
}

.tabs {
  position: sticky;
  top: 0 !important;
  z-index: 4;
  margin: 0 !important;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    min-height: auto !important;
    padding: 14px 18px !important;
  }

  .topbar::before,
  .topbar::after {
    display: none;
  }

  .topbar .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    justify-content: start;
  }

  .topbar .brand-mark {
    width: 92px !important;
    height: 58px !important;
    flex-basis: 92px;
  }

  .topbar .brand strong::after {
    font-size: clamp(24px, 6vw, 34px);
    white-space: normal;
  }

  .profile {
    grid-column: 1 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  body.locked .login-screen {
    grid-template-columns: 1fr;
  }

  .login-screen::before {
    display: none;
  }

  .login-card {
    padding: 24px;
  }

  .login-mark {
    width: 180px !important;
    height: 124px !important;
  }
}

/* Final header logo override */
.topbar::before,
.topbar::after {
  content: none !important;
  display: none !important;
}

.topbar-softplan {
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: start !important;
  align-self: center !important;
  display: flex !important;
  align-items: center !important;
}

.topbar-softplan img {
  display: block !important;
  width: clamp(96px, 12vw, 154px) !important;
  height: auto !important;
  max-height: 46px !important;
  object-fit: contain !important;
}

.topbar-obras {
  grid-column: 3 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  align-self: center !important;
  display: flex !important;
  align-items: center !important;
}

.topbar-obras img {
  display: block !important;
  width: clamp(72px, 8vw, 112px) !important;
  height: auto !important;
  max-height: 58px !important;
  object-fit: contain !important;
}

.topbar .brand {
  gap: 0 !important;
}

.topbar .brand-mark,
.topbar .header-logo {
  display: none !important;
}

@media (max-width: 1180px) {
  .topbar-obras {
    display: none !important;
  }

  .topbar-softplan {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .topbar-softplan img {
    width: 108px !important;
    max-height: 36px !important;
  }

  .topbar .brand {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .profile {
    grid-row: 3 !important;
  }
}

/* Main service portal header - 2026 visual */
.topbar {
  min-height: 108px !important;
  display: grid !important;
  grid-template-columns: 190px minmax(0, 1fr) 190px !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  gap: 8px 20px !important;
  padding: 16px 28px 12px !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.09), transparent 45%),
    linear-gradient(110deg, #063c73 0%, #075a96 48%, #086ba7 100%) !important;
  border-bottom: 1px solid rgba(255,255,255,.18) !important;
  box-shadow: 0 8px 24px rgba(0,40,80,.2) !important;
  color: #fff !important;
  overflow: hidden !important;
}

.topbar::before,
.topbar::after {
  content: none !important;
  display: none !important;
}

.topbar-obras,
.topbar-softplan {
  grid-row: 1 !important;
  align-self: center !important;
  display: inline-flex !important;
  align-items: center !important;
  width: fit-content !important;
  max-width: 100% !important;
  background: rgba(255,255,255,.96) !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.1) !important;
}

.topbar-obras {
  grid-column: 1 !important;
  justify-self: start !important;
  padding: 7px 11px !important;
}

.topbar-softplan {
  grid-column: 3 !important;
  justify-self: end !important;
  padding: 8px 12px !important;
}

.topbar-obras img {
  display: block !important;
  width: auto !important;
  max-width: 160px !important;
  height: auto !important;
  max-height: 58px !important;
  object-fit: contain !important;
  object-position: left center !important;
}

.topbar-softplan img {
  display: block !important;
  width: auto !important;
  max-width: 150px !important;
  height: auto !important;
  max-height: 46px !important;
  object-fit: contain !important;
  object-position: right center !important;
}

.topbar .brand {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  width: 100% !important;
  gap: 0 !important;
  text-align: center !important;
}

.topbar .brand > div {
  min-width: 0 !important;
}

.topbar .brand-mark,
.topbar .header-logo {
  display: none !important;
}

.topbar-unit {
  display: block !important;
  margin: 0 0 6px !important;
  color: rgba(255,255,255,.75) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .08em !important;
  line-height: 1.15 !important;
  text-transform: uppercase !important;
}

.topbar .brand strong {
  display: block !important;
  margin: 0 !important;
  color: #fff !important;
  font-size: 27px !important;
  font-weight: 750 !important;
  line-height: 1.05 !important;
  letter-spacing: -.02em !important;
  white-space: normal !important;
}

.topbar .brand strong::after {
  content: none !important;
  display: none !important;
}

.topbar-subtitle {
  display: block !important;
  margin-top: 5px !important;
  color: #dceeff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.topbar .brand #apiStatus {
  display: none !important;
}

.global-search {
  display: none !important;
}

.profile {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  justify-self: end !important;
  align-self: center !important;
  display: flex !important;
  gap: 8px !important;
  margin: 0 !important;
  position: static !important;
  transform: none !important;
  z-index: 1 !important;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 130px minmax(0, 1fr) 130px !important;
    min-height: 104px !important;
    padding: 14px 18px 12px !important;
    gap: 8px 14px !important;
  }

  .topbar-obras img,
  .topbar-softplan img {
    max-width: 110px !important;
  }

  .topbar-softplan img {
    max-height: 36px !important;
  }

  .topbar .brand strong {
    font-size: 22px !important;
  }

  .topbar-subtitle {
    font-size: 12px !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto auto !important;
    min-height: auto !important;
  }

  .topbar-obras {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .topbar-softplan {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
  }

  .topbar .brand {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }

  .topbar-unit {
    font-size: 9px !important;
  }

  .topbar .brand strong {
    font-size: 22px !important;
  }

  .topbar-subtitle {
    font-size: 12px !important;
  }

  .profile {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    justify-self: start !important;
    flex-wrap: wrap !important;
  }
}

/* Header breathing room */
.topbar {
  min-height: 118px !important;
  padding-top: 18px !important;
  padding-bottom: 14px !important;
  row-gap: 8px !important;
}

.topbar .brand {
  align-self: center !important;
}

.topbar-unit {
  margin-bottom: 4px !important;
  line-height: 1.05 !important;
}

.topbar-subtitle {
  margin-top: 3px !important;
  line-height: 1.05 !important;
}

@media (max-width: 1180px) {
  .topbar {
    min-height: 112px !important;
    padding-top: 16px !important;
    padding-bottom: 12px !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding-top: 18px !important;
    padding-bottom: 16px !important;
    row-gap: 14px !important;
  }
}

/* Lighter header with transparent real logos */
.topbar {
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.22), transparent 48%),
    linear-gradient(110deg, #3aa7e6 0%, #47b9ee 52%, #74d2f4 100%) !important;
}

.topbar-obras,
.topbar-softplan {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.topbar-obras img,
.topbar-softplan img {
  filter: drop-shadow(0 2px 5px rgba(0,20,50,.16)) !important;
}

.topbar-obras img {
  max-width: 176px !important;
  max-height: 56px !important;
}

/* Tighter and centered main header text */
.topbar .brand {
  align-self: center !important;
  justify-self: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.topbar .brand > div {
  display: grid !important;
  justify-items: center !important;
  gap: 0 !important;
  line-height: 1 !important;
}

.topbar-unit {
  margin: 0 0 1px !important;
  line-height: 1 !important;
}

.topbar .brand strong {
  line-height: .94 !important;
}

.topbar-subtitle {
  margin-top: 1px !important;
  line-height: 1 !important;
}
