#ativo [data-ativo-header] {
  display: grid !important;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 1rem;
}

#ativo [data-ativo-foto-panel] {
  justify-self: end;
  align-self: start;
  position: relative;
}

/* Visual refinements for Ativo page cards */
#ativo section.card,
#ativo .card {
  border-radius: .75rem;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 .35rem 1rem rgba(0,0,0,.06);
  overflow: hidden;
}

#ativo .card + .card { margin-top: 1rem; }

#ativo .card > .card-header {
  padding: .5rem .75rem;
  /*background-color: var(--bs-body-bg);*/
  border-bottom-color: rgba(0,0,0,.06);
}

#ativo .card > .card-body {
  padding: .75rem .75rem 1rem .75rem;
}

/* Compact header controls (icons/buttons) */
#ativo [data-ativo-header] .btn.btn-sm { padding: .25rem .4rem; }

/* Smoother rounded image previews */
#ativo img.rounded { border-radius: .5rem !important; }

/* Overlay foto actions inside the image, aligned to bottom */
#ativo [data-ativo-foto-panel] img[data-ativo-foto-preview] {
  display: block;
}

#ativo [data-ativo-foto-panel] [data-ativo-foto-actions] {
  position: absolute;
  right: .5rem;
  bottom: .5rem; /* aligns with the bottom ("chão") of the photo */
  z-index: 2;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(2px);
  border-radius: .375rem;
  padding: .25rem;
}
/* When no photo, show actions inline instead of overlay */
#ativo [data-ativo-foto-panel] [data-ativo-foto-actions].no-photo {
  position: static;
  background: transparent;
  backdrop-filter: none;
  padding: 0;
  margin-top: .25rem;
}

/* Header accent line */
.header-accent {
  height: 2px;
  background-color: #012458; /* dark blue */
  width: 100%;
}

/* Section header title: uppercase and blue */
#ativo .card > .card-header > span:first-child {
  text-transform: uppercase;
  color: #012458;
  font-weight: 600;
  letter-spacing: .02em;
}

.ativo-fab {
  position: fixed;
  bottom: 1.75rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.75rem 1.5rem rgba(1,36,88,0.3);
  z-index: 1050;
}
.ativo-fab i {
  font-size: 1.5rem;
}

.quick-add-proxy {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none !important;
}

[data-ativo-collapsible][data-card-collapsed="true"] > .card-body {
  display: none !important;
}

@media (max-width: 575.98px) {
  .ativo-fab {
    bottom: 1rem;
    right: 1rem;
  }
}

@media (max-width: 575.98px) {
  #authLogModal .modal-footer .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    flex: 1 1 auto;
  }
  #authLogModal .modal-footer .d-flex {
    width: 100%;
    justify-content: space-between;
  }
  #authLogModal .modal-footer {
    gap: 0.5rem !important;
  }
}

/* Profile chooser select: fix arrow and sizing */
[data-profile-chooser] select.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit;
  padding-left: .25rem;
  padding-right: 1.25rem;
  background-repeat: no-repeat;
  background-position: right .25rem center;
  background-size: 12px 8px;
}
[data-profile-chooser] select.form-select:focus { box-shadow: none !important; }

/* Profile chooser: borderless, seamless with header */
[data-profile-chooser] select.form-select {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit;
  padding-left: .25rem;
}

[data-profile-chooser] select.form-select:focus {
  box-shadow: none !important;
}

/* Profile chooser: use dark blue text and badge */
[data-profile-chooser] { color: #012458; }
.profile-badge { background-color: #012458 !important; color: #fff !important; }

/* Navbar toggler: no border, custom blue lines slightly thicker */
.navbar .navbar-toggler {
  border: none !important;
  box-shadow: none !important;
}

.navbar .navbar-toggler:focus { box-shadow: none !important; }

.navbar .navbar-toggler .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(1,36,88,1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
  width: 1.75rem;
  height: 1.75rem;
}

/* Offcanvas menu: make items big and dark blue */
.offcanvas-nav .offcanvas-body .app-link {
  font-size: 1.4rem; /* ~4x default text */
  color: #012458 !important; /* dark blue to match accent */
}

.offcanvas-nav .offcanvas-body .app-link i {
  font-size: 1.2em; /* scale icon within larger text */
}

.offcanvas-nav .offcanvas-body .app-link:hover,
.offcanvas-nav .offcanvas-body .app-link:focus {
  color: #012458 !important;
  text-decoration: none;
}

.offcanvas-nav .offcanvas-body .app-link .badge,
.offcanvas-nav .offcanvas-body .app-link small {
  font-size: .5em;
}

/* Constrain modal width similarly to app container */
@media (min-width: 768px) {
  .modal-dialog { max-width: 768px; }
}

/* Estrutura modal styles */
.estrutura-prumadas { align-items: flex-end; }
.estrutura-prumada { border: 1px solid rgba(1,36,88,.2); border-radius: .5rem; padding: .5rem; }
.estrutura-prumada-title { color:#012458; font-weight:600; text-align:center; margin-bottom:.5rem; }
.estrutura-pavimentos { display:flex; flex-direction:column; gap:.25rem; }
.estrutura-pavimento { width: 96px; height: 22px; border:1px solid #012458; border-radius:.25rem; background:#f8fbff; display:flex; align-items:center; justify-content:center; font-size:.75rem; color:#012458; }

/* Loading overlay to avoid flicker on navigation */
#ativo.is-loading { position: relative; }
#ativo.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(1px);
  z-index: 5;
  pointer-events: all;
  cursor: progress;
}
