/* ============================================================
   my bygga - stylesheet
   Tokens, tipografia (Inter) e algarismos tabulares partilhados
   com o PAT e o CRM: ver assets/css/tokens.css.
   ============================================================ */
@import url("tokens.css");

/* Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
/* O atributo hidden deve sempre ganhar a qualquer regra de display
   definida numa classe (ex: .form, .login-shell usam display:flex,
   o que caso contrário anula o hidden por serem ambas regras de autor). */
[hidden] { display: none !important; }
body {
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.65;
  color: var(--cor-base);
  background: var(--cor-fundo);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { font-family: inherit; }

/* ---- Typography helpers ---- */
.eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
  display: block;
  margin-bottom: 0.75rem;
}
.eyebrow-light { color: rgba(255,255,255,0.5); }

/* ---- Layout ---- */
.inner { max-width: 1200px; margin: 0 auto; padding: 0 2.5rem; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 2.5rem;
  z-index: 200;
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

/* Homepage: hidden while hero menu is visible, white once scrolled past */
.page-home .site-header {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: #e8e2db;
  transition: opacity 0.35s ease, background 0.35s ease, border-color 0.35s ease;
}
.page-home .site-header.header-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Inner pages: always white */
.page-inner .site-header {
  background: #fff;
  border-color: #e8e2db;
}

.header-logo { flex: 0 0 auto; }
.header-logo img { height: 28px; width: auto; }

.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2.25rem;
}
.header-nav a {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(29,31,36,0.6);
  transition: color 0.2s;
  position: relative;
}
.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--cor-acento);
  transition: width 0.3s ease;
}
.header-nav a:hover,
.header-nav a.active { color: var(--cor-base); }
.header-nav a:hover::after,
.header-nav a.active::after { width: 100%; }


.btn-menu {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cor-base);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
}
.btn-menu svg { flex-shrink: 0; }

/* ---- Language toggle ---- */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 1.75rem;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.lang-toggle-link {
  color: rgba(29,31,36,0.45);
  transition: color 0.2s;
  padding: 0.2rem 0;
  cursor: pointer;
}
a.lang-toggle-link:hover { color: var(--cor-base); }
.lang-toggle-link.is-active { color: var(--cor-base); font-weight: 500; }
.lang-toggle-sep { color: rgba(29,31,36,0.2); }
.page-home .site-header:not(.header-hidden) .lang-toggle-link { color: rgba(29,31,36,0.45); }

/* Badge fixo, fora do .site-header - discreto (só texto + moldura),
   visível apenas enquanto o header ainda está escondido (topo da
   homepage, antes do scroll). Assim que o header aparece (com o
   menu), o badge esconde-se - deixa de ser preciso, quem sabe que
   está lá já o viu. */
.reserved-area-btn {
  position: fixed;
  top: 1.375rem;
  right: 2.5rem;
  z-index: 210;
  padding: 0.4rem 0.9rem;
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cor-base);
  background: transparent;
  border: 1px solid rgba(29,31,36,0.3);
  border-radius: 999px;
  transition: all 0.2s ease;
}
.reserved-area-btn:hover { border-color: var(--cor-base); background: rgba(255,255,255,0.15); }
.site-header:not(.header-hidden) + .reserved-area-btn { display: none; }
.page-home .site-header:not(.header-hidden) a.lang-toggle-link:hover,
.page-home .site-header:not(.header-hidden) .lang-toggle-link.is-active { color: var(--cor-base); }

/* ============================================================
   NAV OVERLAY (mobile)
   ============================================================ */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--cor-base);
  z-index: 190;
  display: flex;
  flex-direction: column;
  padding: 0 2.5rem 3rem;
  transform: translateX(-100%);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.nav-overlay.is-open { transform: translateX(0); }

.nav-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  flex-shrink: 0;
}
.nav-overlay-logo img { height: 28px; filter: brightness(0) invert(1); }

.btn-close {
  background: none; border: none; cursor: pointer;
  color: white;
  font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase;
  display: flex; align-items: center; gap: 0.625rem;
}

.nav-overlay-links {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  margin: 2rem 0;
}
.nav-overlay-links li { border-top: 1px solid rgba(255,255,255,0.08); }
.nav-overlay-links li:last-child { border-bottom: 1px solid rgba(255,255,255,0.08); }
.nav-overlay-links a {
  display: block;
  padding: 1.25rem 0;
  font-size: 1.875rem;
  font-weight: 200;
  color: white;
  transition: padding-left 0.25s ease, color 0.2s;
  line-height: 1.2;
}
.nav-overlay-links a:hover { padding-left: 0.75rem; color: var(--cor-texto-secundario); }

.nav-overlay-footer {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}
.nav-overlay-footer a { color: rgba(255,255,255,0.35); transition: color 0.2s; }
.nav-overlay-footer a:hover { color: white; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-media {
  position: absolute;
  inset: 0;
}
.hero-media video,
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.38);
}
.hero-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 2rem;
}
.hero-logo {
  margin-bottom: 2.5rem;
}
.hero-logo img {
  height: 108px;
  width: auto;
}
.hero-title {
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  font-weight: 700;
  color: white;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  margin-bottom: 0.75rem;
}
.hero-subtitle {
  font-size: clamp(1.375rem, 3vw, 2.25rem);
  font-weight: 300;
  color: rgba(255,255,255,0.88);
  margin-bottom: 3rem;
  letter-spacing: 0.04em;
}
.hero-typed {
  color: var(--cor-acento);
  font-style: italic;
}
.typed-cursor {
  color: rgba(255,255,255,0.7);
  animation: blink 0.9s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 1;
  color: rgba(255,255,255,0.55);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hero-scroll::before {
  content: '';
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.35);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 2rem;
  font-family: var(--fonte);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  line-height: 1;
}
.btn-primary { background: white; color: var(--cor-base); }
.btn-primary:hover { background: #f0ede7; }
.btn-outline-light {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.55);
  font-weight: 600;
}
.btn-outline-light:hover {
  background: rgba(205,0,26,0.22);
  border-color: var(--cor-acento);
}
.btn-dark { background: var(--cor-base); color: white; }
.btn-dark:hover { background: #25424e; }
.btn-outline-dark {
  background: transparent;
  color: var(--cor-base);
  border: 1px solid rgba(29,31,36,0.4);
}
.btn-outline-dark:hover { border-color: var(--cor-base); background: rgba(29,31,36,0.04); }
.btn-arrow::after {
  content: '→';
  font-size: 1em;
  margin-left: 0.25rem;
}

/* ============================================================
   SECTIONS - shared
   ============================================================ */
.section { padding: 7rem 0; }
.section-sm { padding: 4rem 0; }
.section-header { margin-bottom: 4rem; }
.section-header .eyebrow { margin-bottom: 0.875rem; }
.section-title {
  font-size: clamp(1.875rem, 4vw, 3.25rem);
  font-weight: 300;
  line-height: 1.12;
}
.section-lead {
  font-size: 1.0625rem;
  color: var(--cor-texto-secundario);
  line-height: 1.8;
  max-width: 560px;
  margin-top: 1.25rem;
}

/* ============================================================
   ABOUT SPLIT (homepage)
   ============================================================ */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}
.about-image { aspect-ratio: 4/5; overflow: hidden; }
.about-image img { width: 100%; height: 100%; object-fit: cover; }
.about-text .eyebrow { margin-bottom: 1rem; }
.about-text h2 {
  font-size: clamp(1.875rem, 3.5vw, 2.875rem);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 1.75rem;
}
.about-text p {
  font-size: 1rem;
  color: var(--cor-texto-secundario);
  line-height: 1.85;
  margin-bottom: 1.25rem;
}
.about-text .btn { margin-top: 0.75rem; }

/* ============================================================
   PORTFOLIO (homepage feature grid)
   ============================================================ */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 1rem;
}
.pcard {
  position: relative;
  overflow: hidden;
  background: var(--cor-base);
}
.pcard-tall { grid-row: span 2; }
.pcard-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 240px;
}
.pcard-tall .pcard-img { min-height: 480px; }
.pcard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  display: block;
}
.pcard:hover .pcard-img img { transform: scale(1.05); }
.pcard-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(29,31,36,0.88) 0%, transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem 1.5rem;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}
.pcard:hover .pcard-overlay { opacity: 1; }
.pcard-overlay .eyebrow { color: rgba(255,255,255,0.55); margin-bottom: 0.4rem; font-size: 0.625rem; }
.pcard-overlay h3 {
  color: white;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.3;
}

/* ============================================================
   SERVICES (homepage preview)
   ============================================================ */
.services-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-top: 3rem;
}
.service-preview-item { border-top: 1px solid var(--cor-linha); padding-top: 1.75rem; }
.service-preview-item .num {
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  color: var(--cor-texto-secundario);
  margin-bottom: 1rem;
}
.service-preview-item h3 {
  font-size: 1.1875rem;
  font-weight: 300;
  margin-bottom: 0.875rem;
  line-height: 1.25;
}
.service-preview-item p {
  font-size: 0.9375rem;
  color: var(--cor-texto-secundario);
  line-height: 1.75;
}

/* ============================================================
   FULL SERVICES LIST (servicos page)
   ============================================================ */
.services-full { margin-top: 1rem; }
.service-row {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 2.5rem;
  padding: 3rem 0;
  border-top: 1px solid var(--cor-linha);
  align-items: start;
}
.service-row:last-child { border-bottom: 1px solid var(--cor-linha); }
.service-row-num {
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  color: var(--cor-texto-secundario);
  padding-top: 5px;
}
.service-row-content {}
.service-row-title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 300;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.service-row-desc {
  font-size: 0.9375rem;
  color: var(--cor-texto-secundario);
  line-height: 1.8;
  max-width: 640px;
}

/* ============================================================
   PROJECTS FILTER
   ============================================================ */
.projects-filter {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}
.projects-filter-btn {
  background: transparent;
  border: 1px solid rgba(29,31,36,0.3);
  color: rgba(29,31,36,0.55);
  font-family: var(--fonte);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.projects-filter-btn:hover {
  border-color: var(--cor-acento);
  color: var(--cor-acento);
}
.projects-filter-btn.is-active {
  background: var(--cor-base);
  border-color: var(--cor-base);
  color: white;
}
.proj-item.is-hidden {
  display: none;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid-full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.proj-item { cursor: pointer; display: block; color: inherit; }
.proj-item-thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--dados-5);
  margin-bottom: 1.25rem;
  position: relative;
}
.proj-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}
.proj-item:hover .proj-item-thumb img { transform: scale(1.04); }
.proj-item-thumb::after {
  content: '+';
  position: absolute;
  bottom: 1rem; right: 1rem;
  width: 2.25rem; height: 2.25rem;
  background: rgba(255,255,255,0.92);
  color: var(--cor-base);
  font-size: 1.375rem;
  font-weight: 300;
  line-height: 2.25rem;
  text-align: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.proj-item:hover .proj-item-thumb::after {
  opacity: 1;
  transform: scale(1);
}
.proj-item-meta .eyebrow { margin-bottom: 0.35rem; font-size: 0.625rem; }
.proj-item-meta h3 { font-size: 1.125rem; font-weight: 400; }

/* ============================================================
   PROJECT DETAIL
   ============================================================ */
.proj-detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
.proj-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.proj-gallery-item {
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--dados-5);
}
.proj-gallery-item:first-child {
  grid-column: 1 / -1;
  aspect-ratio: 16/7;
}
.proj-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.proj-gallery-item:hover img { transform: scale(1.04); }

.proj-detail-info {
  background: #f2ede6;
  padding: 2rem;
  position: sticky;
  top: 88px;
}
.proj-detail-info-title {
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--cor-linha);
}
.proj-detail-info dl { display: flex; flex-direction: column; gap: 1.5rem; }
.proj-detail-info dt {
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
  margin-bottom: 0.3rem;
}
.proj-detail-info dd { font-size: 0.9375rem; color: var(--cor-base); line-height: 1.65; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: all; }
.lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; display: block; }
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 2rem;
  color: rgba(255,255,255,0.7);
  font-size: 2.5rem;
  cursor: pointer;
  background: none; border: none;
  line-height: 1;
  transition: color 0.2s;
}
.lightbox-close:hover { color: white; }
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 3rem;
  cursor: pointer;
  background: none; border: none;
  padding: 1rem 1.5rem;
  line-height: 1;
  transition: color 0.2s;
}
.lightbox-prev:hover, .lightbox-next:hover { color: white; }
.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

/* Back link in project hero */
.page-hero .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.55);
  font-size: 0.8125rem;
  margin-top: 1.5rem;
  transition: color 0.2s;
}
.page-hero .back-link:hover { color: white; }

/* ============================================================
   INSIGHTS
   ============================================================ */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 0.5rem;
}
.insight-card {
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--cor-base);
  padding-top: 1.5rem;
  color: inherit;
  transition: border-color 0.2s;
}
a.insight-card:hover { border-color: var(--cor-acento); }
a.insight-card:hover h3 { color: var(--cor-base); }
.insight-card .eyebrow { margin-bottom: 0.875rem; }
.insight-card h3 {
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.45;
  margin-bottom: 1.25rem;
  flex: 1;
  transition: color 0.2s;
}
.insight-card-footer {
  font-size: 0.75rem;
  color: var(--cor-texto-secundario);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.insight-card-footer::before {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--cor-linha);
}
.insight-card.is-soon { opacity: 0.5; cursor: default; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-layout {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 6rem;
  align-items: start;
}
.contact-info h2 {
  font-size: clamp(1.75rem, 3vw, 2.625rem);
  font-weight: 300;
  margin-bottom: 2.5rem;
  line-height: 1.15;
}
.contact-detail { margin-bottom: 2rem; }
.contact-detail dt {
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
  margin-bottom: 0.4rem;
}
.contact-detail dd { font-size: 1rem; }
.contact-detail a { transition: color 0.2s; }
.contact-detail a:hover { color: var(--cor-texto-secundario); }
.contact-tariff { display: block; font-size: 0.75rem; color: #999; margin-top: 0.25rem; }

.form { display: flex; flex-direction: column; gap: 1.125rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.125rem; }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field label {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #d0c8bf;
  background: white;
  font-family: var(--fonte);
  font-size: 0.9375rem;
  color: var(--cor-base);
  outline: none;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--cor-base); }
.form-field textarea { resize: vertical; min-height: 140px; }
.form-submit { padding-top: 0.5rem; }
.form-submit .btn { width: 100%; justify-content: center; }

/* ============================================================
   QUOTE SECTION
   ============================================================ */
.quote-section {
  background: var(--cor-base);
  padding: 8rem 2.5rem;
  text-align: center;
}
.quote-text {
  font-size: clamp(1.625rem, 3.5vw, 2.75rem);
  font-weight: 200;
  color: white;
  max-width: 900px;
  margin: 0 auto 3rem;
  line-height: 1.4;
}
.quote-text em { font-style: italic; }
.quote-source {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 3rem;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { border-left: 1px solid var(--cor-linha); padding-left: 3rem; }
.tl-item {
  position: relative;
  padding-bottom: 3rem;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -3rem;
  top: 6px;
  width: 9px; height: 9px;
  background: var(--dados-4);
  border-radius: 50%;
  transform: translateX(-4px);
}
.tl-year {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--cor-texto-secundario);
  padding-top: 2px;
}
.tl-body h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.tl-body p {
  font-size: 0.9375rem;
  color: var(--cor-texto-secundario);
  line-height: 1.7;
}

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */
.page-hero {
  background: var(--cor-base);
  padding: 11rem 0 5.5rem;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 50%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"><circle cx="400" cy="0" r="350" fill="none" stroke="rgba(255,255,255,0.04)" stroke-width="1"/><circle cx="400" cy="0" r="250" fill="none" stroke="rgba(255,255,255,0.04)" stroke-width="1"/></svg>') no-repeat right top;
  pointer-events: none;
}
.page-hero .eyebrow { color: rgba(255,255,255,0.45); margin-bottom: 1.25rem; }
.page-hero h1 {
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-weight: 200;
  color: white;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  position: relative;
}
.page-hero p {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.65);
  max-width: 540px;
  line-height: 1.8;
  position: relative;
}

/* ============================================================
   ÁREA RESERVADA
   ============================================================ */
.area-reservada-inner { display: flex; justify-content: center; }
.area-reservada-card { width: 100%; max-width: 420px; }
/* Menu principal: 6x2 dimensionado pela própria grelha (tiles.css),
   para caber no ecrã sem scroll - daí não levar teto de largura. */
#ar-tiles-view.area-reservada-card { max-width: 1400px; }
.area-reservada-intro { color: var(--cor-texto-secundario); font-size: 0.9375rem; margin-bottom: 1.75rem; line-height: 1.7; }
.area-reservada-loading { color: var(--cor-texto-secundario); font-size: 0.9375rem; }
/* Tiles: em assets/css/tiles.css (partilhado com o PAT). */
.area-reservada-empty p { margin-bottom: 1rem; color: var(--cor-texto-secundario); font-size: 0.9375rem; line-height: 1.7; }
.area-reservada-empty a { text-decoration: underline; }

/* ---- Login (caixa única, centrada) ---- */
.login-shell {
  display: flex;
  width: 100%;
  max-width: 440px;
  border: 1px solid rgba(29,31,36,0.12);
  border-radius: 2px;
  overflow: hidden;
}

.login-form-panel {
  flex: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
}
.login-form-inner { width: 100%; max-width: 320px; }
.login-form-title { font-size: 1.375rem; font-weight: 400; margin-bottom: 0.25rem; }
.login-form-sub { font-size: 0.8125rem; color: var(--cor-texto-secundario); margin-bottom: 1.75rem; }

.form-label-row { display: flex; align-items: baseline; justify-content: space-between; }
.form-label-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  color: var(--cor-texto-secundario);
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}
.form-label-link:hover { color: var(--cor-base); }
.form-input-wrapper { position: relative; }
.form-input-icon { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--cor-texto-secundario); pointer-events: none; }
.form-field input.has-icon { padding-left: 2.5rem; }
.form-field input.has-icon-right { padding-right: 2.5rem; }
.form-input-toggle {
  position: absolute; right: 0.625rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px; color: var(--cor-texto-secundario);
}
.form-input-toggle:hover { color: var(--cor-base); }
.form-input-toggle svg { width: 18px; height: 18px; display: block; }

/* ---- Backoffice ---- */
.backoffice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3rem;
}
.backoffice-header h1 { font-size: 1.75rem; font-weight: 300; }
.backoffice-section { margin-bottom: 4rem; }
.backoffice-section h2 { font-size: 1.25rem; font-weight: 400; margin-bottom: 0.5rem; }
.backoffice-table-wrap { overflow-x: auto; margin-top: 1.5rem; }
.backoffice-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.backoffice-table th {
  text-align: left;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
  padding: 0 1rem 0.75rem 0;
  border-bottom: 1px solid rgba(29,31,36,0.15);
}
.backoffice-table td {
  padding: 0.875rem 1rem 0.875rem 0;
  border-bottom: 1px solid rgba(29,31,36,0.08);
}
.backoffice-table th:nth-child(n+3), .backoffice-table td:nth-child(n+3) { text-align: center; }
.backoffice-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--cor-base); }
.backoffice-links { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
.backoffice-link { font-size: 0.9375rem; text-decoration: underline; }
.backoffice-link:hover { color: var(--cor-acento); }

/* Navegação entre secções do backoffice */
.backoffice-nav {
  display: flex;
  gap: 2rem;
  border-bottom: 1px solid rgba(29,31,36,0.15);
  margin-bottom: 3rem;
}
.backoffice-nav a {
  padding-bottom: 0.875rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.backoffice-nav a:hover { color: var(--cor-base); }
.backoffice-nav a.is-active { color: var(--cor-base); border-color: var(--cor-acento); }

/* Sub-abas dentro de uma secção (ex: Pressupostos: VPT / IMI / IMT / Mais-Valias) */
.backoffice-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.backoffice-tab {
  padding: 0.5rem 1.125rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(29,31,36,0.15);
  border-radius: 999px;
  color: var(--cor-texto-secundario);
  cursor: pointer;
  background: transparent;
  font-family: inherit;
}
.backoffice-tab:hover { border-color: var(--cor-base); color: var(--cor-base); }
.backoffice-tab.is-active { background: var(--cor-base); border-color: var(--cor-base); color: #fff; }
.backoffice-panel { display: none; }
.backoffice-panel.is-active { display: block; }

/* Cartões de estatística */
.backoffice-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: rgba(29,31,36,0.1); margin-bottom: 2.5rem; }
.backoffice-stat { background: #fff; padding: 1.25rem 1.5rem; }
.backoffice-stat-value { font-size: 1.75rem; font-weight: 300; color: var(--cor-base); }
.backoffice-stat-label { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cor-texto-secundario); margin-top: 0.25rem; }

/* Badges de estado / evento */
.backoffice-badge {
  display: inline-block;
  padding: 0.2rem 0.625rem;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  border-radius: 999px;
  background: rgba(29,31,36,0.08);
  color: var(--cor-texto-secundario);
}
/* Tokens da paleta semântica (tokens.css) em vez dos valores improvisados
   que estes badges tinham antes de a paleta existir. */
.backoffice-badge.is-success { background: var(--cor-sucesso-tinte); color: var(--cor-sucesso-texto); }
.backoffice-badge.is-warning { background: var(--cor-aviso-tinte); color: var(--cor-aviso-texto); }
.backoffice-badge.is-danger { background: var(--cor-erro-tinte); color: var(--cor-erro-texto); }
.backoffice-badge.is-muted { background: rgba(29,31,36,0.06); color: var(--cor-texto-secundario); }

/* Ações de ícone dentro de uma linha de tabela */
.backoffice-icon-btn {
  background: none; border: none; cursor: pointer; padding: 0.35rem;
  color: var(--cor-texto-secundario); display: inline-flex; align-items: center; justify-content: center;
}
.backoffice-icon-btn:hover { color: var(--cor-base); }
.backoffice-icon-btn.is-danger:hover { color: var(--cor-acento); }
.backoffice-icon-btn svg { width: 16px; height: 16px; }

/* Modal simples (criar/editar) */
.backoffice-modal-overlay {
  position: fixed; inset: 0; background: rgba(29,31,36,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; z-index: 300;
}
.backoffice-modal {
  background: #fff; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  padding: 2.5rem; border-radius: 2px;
}
.backoffice-modal h3 { font-size: 1.25rem; font-weight: 400; margin-bottom: 1.5rem; }
/* Separa blocos de campos dentro de um formulário longo (ex.: os dados de
   contabilidade na ficha da sociedade). */
.backoffice-form-subtitle {
  font-size: 0.8125rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--cor-texto-secundario);
  margin: 2rem 0 1rem; padding-top: 1.25rem;
  border-top: 1px solid var(--cor-linha);
}
.backoffice-modal-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.backoffice-modal-actions .btn { flex: 1; justify-content: center; }

/* Toast de confirmação */
.backoffice-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 400;
  padding: 0.875rem 1.25rem; border-radius: 2px; font-size: 0.875rem;
  background: var(--cor-base); color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.backoffice-toast.is-visible { opacity: 1; transform: translateY(0); }
.backoffice-toast.is-error { background: #7b1c1c; }

/* Banner de impersonação ("Ver como") */
.backoffice-impersonate-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  height: 38px; background: #b9762c; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 0.625rem;
  font-size: 0.8125rem;
}
.backoffice-impersonate-banner button {
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; cursor: pointer;
}

/* Filtros simples (selects/inputs numa linha) */
.backoffice-filters { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: flex-end; }
.backoffice-filters .form-field { min-width: 160px; margin-bottom: 0; }
.backoffice-filters input, .backoffice-filters select {
  width: 100%; padding: 0.625rem 0.75rem; border: 1px solid rgba(29,31,36,0.2);
  font-family: inherit; font-size: 0.875rem; background: #fff;
}

/* Checklist (permissões/plataformas dentro de modais) */
.backoffice-checklist { display: flex; flex-direction: column; gap: 0.625rem; margin-top: 0.5rem; }
.backoffice-checklist label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 400; margin: 0; cursor: pointer; }
.backoffice-checklist input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--cor-base); cursor: pointer; }
.backoffice-checklist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; max-height: 260px; overflow-y: auto; padding: 0.25rem; border: 1px solid rgba(29,31,36,0.1); }

/* Barra de ações acima da tabela (contagem de registos + exportação) */
.backoffice-table-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.backoffice-table-count { font-size: 0.8125rem; color: var(--cor-texto-secundario); }

/* Células de tabela com duas linhas (ex: nome+email, data+hora) */
.backoffice-cell-main { display: block; color: var(--cor-base); }
.backoffice-cell-sub { display: block; font-size: 0.8125rem; color: var(--cor-texto-secundario); margin-top: 0.15rem; }

/* Estado vazio / a carregar dentro da tabela */
.backoffice-table-empty { text-align: center; color: var(--cor-texto-secundario); padding: 2rem 0 !important; }

/* Cabeçalho de secção com ação (ex: título + "Criar") */
.backoffice-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.backoffice-section-head h2 { margin-bottom: 0; }

/* Grupo de ações dentro de uma célula de tabela (botões/ícones) */
.apf-row-actions { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.apf-row-actions .btn { padding: 0.625rem 1.125rem; }

/* Rótulo de checkbox simples dentro de um form (ex: "Acesso ativo") */
.apf-inline-check {
  display: flex; align-items: center; gap: 0.5rem;
  text-transform: none; letter-spacing: normal; font-size: 0.875rem; color: var(--cor-base);
}
.apf-inline-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--cor-base); cursor: pointer; }

/* Campos de formulário desativados (pré-preenchidos, só leitura) */
.form-field input:disabled { background: #f2ede6; color: var(--cor-texto-secundario); cursor: not-allowed; }

@media (max-width: 768px) {
  .backoffice-nav { gap: 1.25rem; overflow-x: auto; }
  .backoffice-stats { grid-template-columns: repeat(2, 1fr); }
  .backoffice-checklist-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .login-shell { border-radius: 0; border: none; box-shadow: none; max-width: 100%; }
  .login-form-panel { padding: 2.5rem 1.5rem; }
}
.btn-logout, .btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
  cursor: pointer;
  text-decoration: underline;
}
.btn-logout:hover, .btn-link:hover { color: var(--cor-base); }
.btn-link { display: block; margin-top: 0.875rem; }
.btn-logout { display: block; width: fit-content; margin: 0.5rem auto 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #141f24;
  color: rgba(255,255,255,0.4);
  padding: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy { font-size: 0.75rem; }
.footer-links {
  display: flex;
  gap: 2rem;
  font-size: 0.75rem;
}
.footer-links a { color: rgba(255,255,255,0.4); transition: color 0.2s; }
.footer-links a:hover { color: rgba(255,255,255,0.8); }

/* ============================================================
   MISC / UTILITIES
   ============================================================ */
.bg-warm { background: #f2ede6; }
.bg-dark { background: var(--cor-base); }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Form status messages */
.form-status {
  padding: 1rem;
  font-size: 0.875rem;
  display: none;
}
.form-status.success { background: var(--cor-sucesso-tinte); color: var(--cor-sucesso-texto); display: block; }
.form-status.error { background: var(--cor-erro-tinte); color: var(--cor-erro-texto); display: block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .about-split { grid-template-columns: 1fr; gap: 3rem; }
  .about-image { aspect-ratio: 16/9; max-height: 420px; }
  .portfolio-grid { grid-template-columns: 1fr 1fr; }
  .pcard-tall { grid-row: span 1; }
  .pcard-tall .pcard-img { min-height: 280px; }
  .services-preview { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .contact-layout { grid-template-columns: 1fr; gap: 3rem; }
  .insights-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid-full { grid-template-columns: repeat(2, 1fr); }
  .proj-detail-layout { grid-template-columns: 1fr; }
  .proj-detail-info { position: static; }
}

@media (max-width: 768px) {
  .site-header { padding: 0 1.5rem; }
  .header-nav { display: none; }
  .reserved-area-btn { right: 1.5rem; }
  .btn-menu { display: flex; }
  .section { padding: 5rem 0; }
  .inner { padding: 0 1.5rem; }
  .hero-content { padding: 0 1.5rem 4rem; }
  .hero-scroll { display: none; }
  .portfolio-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .services-preview { grid-template-columns: 1fr; }
  .projects-grid-full { grid-template-columns: 1fr 1fr; }
  .proj-gallery { grid-template-columns: 1fr 1fr; }
  .proj-gallery-item:first-child { aspect-ratio: 4/3; }
  .insights-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-hero { padding: 9rem 0 4rem; }
  .quote-section { padding: 5rem 1.5rem; }
  .service-row { grid-template-columns: 1fr; gap: 0.75rem; }
  .service-row-num { display: none; }
  .site-footer { padding: 2rem 1.5rem; flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* ============================================================
   BACKOFFICE - Pressupostos (tabelas/formulários editáveis)
   ============================================================ */
.backoffice-card {
  border: 1px solid rgba(29,31,36,0.12);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.backoffice-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.backoffice-card-header h4 { font-size: 0.9375rem; font-weight: 500; }
.backoffice-subsection { margin-top: 1.75rem; }
.backoffice-subsection h5 {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
  margin-bottom: 0.75rem;
}
.backoffice-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.backoffice-field-grid .form-field { margin-bottom: 0; }
.backoffice-table input[type="number"],
.backoffice-table input[type="text"] {
  width: 100%;
  min-width: 90px;
  padding: 0.5rem 0.625rem;
  border: 1px solid #d0c8bf;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--cor-base);
  background: #fff;
  border-radius: 0;
}
.backoffice-table input:focus { border-color: var(--cor-base); outline: none; }
.backoffice-table td.is-actions { width: 40px; text-align: center !important; }
.backoffice-row-add { margin-top: 0.75rem; }
.btn-sm { padding: 0.55rem 1.125rem; font-size: 0.625rem; }
.backoffice-panel-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.backoffice-panel-actions .form-status { margin: 0; flex: 1; min-width: 200px; }
.form-hint { font-size: 0.75rem; color: var(--cor-texto-secundario); line-height: 1.6; margin-bottom: 1rem; }
.backoffice-tabs-sub { margin-bottom: 1.75rem; }

@media (max-width: 768px) {
  .backoffice-card { padding: 1.25rem; }
  .backoffice-panel-actions { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   APP-BAR - chrome do "my bygga" depois do login.
   Substitui o header/footer de marketing do site: já não estamos
   no site público, estamos dentro da plataforma de trabalho.
   ============================================================ */
/* App-bar: em assets/css/app-bar.css (partilhado com o PAT). */

/* ============================================================
   GESTÃO DE TAREFAS (estilo Reminders)
   ============================================================ */
.tsk-layout { display: flex; gap: 0; align-items: flex-start; max-width: 1100px; margin: 0 auto; }
.tsk-sidebar {
  width: 220px; flex-shrink: 0; border-right: 1px solid rgba(29,31,36,0.08);
  padding-right: 1.5rem; margin-right: 1.5rem;
}
.tsk-smart-list { display: flex; flex-direction: column; gap: 0.125rem; margin-bottom: 1.75rem; }
.tsk-nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.5rem 0.625rem; border-radius: 2px; font-size: 0.875rem; color: var(--cor-base);
  cursor: pointer; background: none; border: none; width: 100%; text-align: left; font-family: inherit;
}
.tsk-nav-item:hover { background: #f4f1ee; }
.tsk-nav-item.is-active { background: var(--cor-base); color: #fff; }
.tsk-nav-item.is-active .tsk-nav-count { color: rgba(255,255,255,0.6); }
.tsk-nav-count { font-size: 0.75rem; color: var(--cor-texto-secundario); }
.tsk-sidebar-section-title {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--cor-texto-secundario); margin-bottom: 0.5rem; padding: 0 0.625rem;
}
.tsk-main { flex: 1; min-width: 0; }
.tsk-quickadd { display: flex; gap: 0.625rem; margin-bottom: 1.75rem; }
.tsk-quickadd input {
  flex: 1; padding: 0.75rem 0.875rem; border: 1px solid rgba(29,31,36,0.15);
  font-family: inherit; font-size: 0.9375rem; border-radius: 2px;
}
.tsk-quickadd input:focus { border-color: var(--cor-base); outline: none; }
.tsk-group { margin-bottom: 1.75rem; }
.tsk-group-title {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--cor-texto-secundario); margin-bottom: 0.625rem;
}
.tsk-row {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.625rem 0.5rem; border-radius: 2px; cursor: pointer;
}
.tsk-row:hover { background: #f9f6f1; }
.tsk-row.is-subtask { padding-left: 2.25rem; }
.tsk-checkbox {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(29,31,36,0.3);
  flex-shrink: 0; margin-top: 0.0625rem; cursor: pointer; background: #fff;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.tsk-checkbox.is-checked { background: var(--cor-base); border-color: var(--cor-base); }
.tsk-checkbox.is-checked svg { width: 12px; height: 12px; color: #fff; }
.tsk-checkbox.priority-alta { border-color: var(--cor-acento); }
.tsk-row-body { flex: 1; min-width: 0; }
.tsk-row-title { font-size: 0.9375rem; color: var(--cor-base); }
.tsk-row.is-done .tsk-row-title { color: var(--cor-texto-secundario); text-decoration: line-through; }
.tsk-row-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.2rem; font-size: 0.75rem; color: var(--cor-texto-secundario); }
.tsk-row-meta .is-overdue { color: var(--cor-acento); }
.tsk-flag { color: var(--cor-acento); }
.tsk-empty { color: var(--cor-texto-secundario); font-size: 0.875rem; padding: 2rem 0.5rem; text-align: center; }

/* Painel de edição (reaproveita backoffice-modal, com extras) */
.tsk-field-row { display: flex; gap: 0.75rem; }
.tsk-field-row .form-field { flex: 1; }
.tsk-priority-picker { display: flex; gap: 0.5rem; }
.tsk-priority-btn {
  flex: 1; padding: 0.5rem; border: 1px solid rgba(29,31,36,0.15); border-radius: 2px;
  background: #fff; cursor: pointer; font-size: 0.8125rem; color: var(--cor-texto-secundario); font-family: inherit;
}
.tsk-priority-btn.is-active { border-color: var(--cor-base); background: var(--cor-base); color: #fff; }
.tsk-subtasks { margin-top: 0.5rem; }
.tsk-subtask-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0; }
.tsk-subtask-row input[type="text"] { flex: 1; border: none; border-bottom: 1px solid rgba(29,31,36,0.1); padding: 0.25rem; font-family: inherit; font-size: 0.875rem; }
.tsk-subtask-add { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.tsk-subtask-add input { flex: 1; padding: 0.5rem; border: 1px dashed rgba(29,31,36,0.2); border-radius: 2px; font-family: inherit; font-size: 0.875rem; }

@media (max-width: 768px) {
  .tsk-layout { flex-direction: column; }
  .tsk-sidebar {
    width: 100%; border-right: none; padding-right: 0; margin-right: 0;
    border-bottom: 1px solid rgba(29,31,36,0.08); padding-bottom: 1rem; margin-bottom: 1.5rem;
  }
  .tsk-smart-list { flex-direction: row; flex-wrap: wrap; margin-bottom: 1rem; }
  .tsk-nav-item { width: auto; }
}

/* ============================================================
   PORTFÓLIO (histórico de investimentos)
   ============================================================ */
.pf-table { font-size: 0.8125rem; white-space: nowrap; }
.pf-table th, .pf-table td { padding: 0.5rem 0.75rem 0.5rem 0; text-align: right; }
.pf-table th:nth-child(1), .pf-table td:nth-child(1),
.pf-table th:nth-child(2), .pf-table td:nth-child(2) { text-align: left; white-space: normal; }
.pf-table thead tr:first-child th { text-align: center; border-bottom: 1px solid rgba(29,31,36,0.1); }
.pf-table tfoot td { font-weight: 600; background: rgba(29,31,36,0.03); border-top: 2px solid rgba(29,31,36,0.15); }

/* ============================================================
   GESTÃO DE PROJETOS - lista por sociedade + quadro Kanban
   ============================================================ */

/* ---- Entrada: projetos agrupados por sociedade ---- */
.prj-society-group { margin-bottom: 2.5rem; }
.prj-society-title {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--cor-texto-secundario); margin-bottom: 0.875rem;
}
.prj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.prj-card {
  border: 1px solid rgba(29,31,36,0.12); background: #fff; padding: 1.25rem;
  display: block; cursor: pointer; transition: border-color 0.2s, transform 0.15s;
}
.prj-card:hover { border-color: var(--cor-base); transform: translateY(-1px); }
.prj-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.prj-card-nome { font-size: 1rem; color: var(--cor-base); }
.prj-card-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; font-size: 0.75rem; color: var(--cor-texto-secundario); }
.prj-progress-track { height: 4px; background: rgba(29,31,36,0.08); border-radius: 999px; margin-top: 1rem; overflow: hidden; }
.prj-progress-bar { height: 100%; background: var(--cor-base); border-radius: 999px; transition: width 0.3s; }
.prj-progress-label { font-size: 0.6875rem; color: var(--cor-texto-secundario); margin-top: 0.375rem; }

/* ---- Quadro Kanban ---- */
.kan-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.kan-back { font-size: 0.8125rem; color: var(--cor-texto-secundario); background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; }
.kan-back:hover { color: var(--cor-base); }

.kan-board {
  display: flex; gap: 1rem; align-items: flex-start;
  overflow-x: auto; padding-bottom: 1rem;
}
.kan-col {
  flex: 0 0 280px; background: rgba(29,31,36,0.03);
  border-radius: 2px; padding: 0.875rem; min-height: 120px;
}
.kan-col.is-dragover { background: rgba(205,0,26,0.06); outline: 1.5px dashed rgba(205,0,26,0.4); }
.kan-col-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.kan-col-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cor-texto-secundario); }
.kan-col-count { font-size: 0.75rem; color: var(--cor-texto-secundario); }
.kan-col-menu { background: none; border: none; cursor: pointer; color: var(--cor-texto-secundario); padding: 2px 4px; font-family: inherit; }
.kan-col-menu:hover { color: var(--cor-base); }

.kan-card {
  background: #fff; border: 1px solid rgba(29,31,36,0.1); border-radius: 2px;
  padding: 0.75rem; margin-bottom: 0.5rem; cursor: grab;
}
.kan-card:hover { border-color: rgba(29,31,36,0.3); }
.kan-card.is-dragging { opacity: 0.4; }
.kan-card.is-done .kan-card-title { color: var(--cor-texto-secundario); text-decoration: line-through; }
.kan-card-title { font-size: 0.875rem; color: var(--cor-base); line-height: 1.4; }
.kan-card-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.5rem; font-size: 0.6875rem; color: var(--cor-texto-secundario); }
.kan-card-meta .is-overdue { color: var(--cor-acento); }
.kan-prio { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.kan-prio.alta { background: var(--cor-acento); }
.kan-prio.media { background: #b9762c; }
.kan-prio.baixa { background: rgba(29,31,36,0.3); }

.kan-quickadd input {
  width: 100%; padding: 0.5rem 0.625rem; border: 1px dashed rgba(29,31,36,0.2);
  border-radius: 2px; font-family: inherit; font-size: 0.8125rem; background: transparent;
}
.kan-quickadd input:focus { border-style: solid; border-color: var(--cor-base); background: #fff; outline: none; }

.kan-addcol {
  flex: 0 0 220px; border: 1px dashed rgba(29,31,36,0.2); border-radius: 2px;
  padding: 0.875rem; background: none; cursor: pointer; font-family: inherit;
  font-size: 0.8125rem; color: var(--cor-texto-secundario); text-align: center;
}
.kan-addcol:hover { border-color: var(--cor-base); color: var(--cor-base); }

/* ============================================================
   TESOURARIA
   ============================================================ */

/* ---- Indicadores ---- */
.tes-kpis {
  display: grid; gap: 1rem; margin-bottom: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.tes-kpi {
  background: #fff; border: 1px solid rgba(29,31,36,0.1); border-radius: 2px;
  padding: 1rem 1.125rem; display: flex; flex-direction: column; gap: 0.125rem;
}
.tes-kpi-rot { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cor-texto-secundario); }
.tes-kpi-val { font-size: 1.375rem; font-weight: 400; color: var(--cor-base); line-height: 1.3; }
.tes-kpi-val.is-neg { color: var(--cor-acento); }
.tes-kpi-nota { font-size: 0.75rem; color: var(--cor-texto-secundario); }

/* ---- Contas ---- */
.tes-contas {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.tes-conta {
  background: #fff; border: 1px solid rgba(29,31,36,0.1); border-radius: 2px;
  padding: 1rem 1.125rem; display: flex; flex-direction: column; gap: 0.125rem;
  text-align: left; cursor: pointer; font-family: inherit;
}
.tes-conta:hover { border-color: rgba(29,31,36,0.35); }
.tes-conta.is-inativa { opacity: 0.55; }
.tes-conta-nome { font-size: 0.9375rem; color: var(--cor-base); }
.tes-conta-soc { font-size: 0.75rem; color: var(--cor-texto-secundario); }
.tes-conta-saldo { font-size: 1.25rem; font-weight: 400; color: var(--cor-base); margin-top: 0.375rem; }
.tes-conta-saldo.is-neg { color: var(--cor-acento); }
.tes-conta-nota { font-size: 0.6875rem; color: var(--cor-texto-secundario); }

/* ---- Previsão (SVG puro, sem biblioteca) ---- */
.tes-sparkline { width: 100%; margin-top: 0.75rem; }
.tes-sparkline svg { width: 100%; height: 160px; display: block; }
.tes-linha { fill: none; stroke: var(--cor-base); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tes-eixo-zero { stroke: var(--cor-acento); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.tes-sparkline-eixo {
  display: flex; justify-content: space-between;
  font-size: 0.6875rem; color: var(--cor-texto-secundario); margin-top: 0.25rem;
}

/* ---- Filtros ---- */
.tes-filtros { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.tes-filtros input, .tes-filtros select {
  flex: 1 1 170px; min-width: 0;
  padding: 0.5rem 0.75rem; border: 1px solid rgba(29,31,36,0.15);
  border-radius: 2px; font-family: inherit; font-size: 0.8125rem; background: #fff;
}
.tes-filtros input:focus, .tes-filtros select:focus { outline: none; border-color: var(--cor-base); }

/* ---- Tabela de movimentos ---- */
.tes-pos { color: var(--cor-base); }
.tes-neg { color: var(--cor-acento); }
.tes-doc { font-size: 0.6875rem; color: var(--cor-texto-secundario); }
/* Previstos: menos peso visual - ainda não aconteceram. */
.backoffice-table tr.is-previsto td { opacity: 0.72; }
.tes-badge {
  display: inline-block; font-size: 0.6875rem; padding: 0.125rem 0.5rem;
  border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.tes-badge-realizado    { background: rgba(29,31,36,0.06); color: var(--cor-texto-secundario); }
.tes-badge-previsto     { background: rgba(185,118,44,0.1); color: #b9762c; border-color: rgba(185,118,44,0.25); }
.tes-badge-reconciliado { background: rgba(46,125,80,0.1); color: #2e7d50; border-color: rgba(46,125,80,0.25); }

@media (max-width: 640px) {
  .tes-filtros input, .tes-filtros select { flex: 1 1 100%; }
}

@media (max-width: 640px) {
  .kan-col { flex: 0 0 82vw; }
}


/* ---- Matriz de acessos (Definições → Utilizadores) ----
   Invertida (18/08/2026): utilizadores em coluna, módulos em linha. São
   poucos utilizadores e muitos módulos, por isso lê-se na horizontal
   sem nomes na vertical. A coluna dos módulos fica fixa ao rolar. */
.bo-acessos-wrap { overflow-x: auto; border: 1px solid var(--cor-linha); }
.bo-acessos { border-collapse: collapse; font-size: 0.8125rem; width: 100%; }
.bo-acessos th, .bo-acessos td { border-bottom: 1px solid var(--cor-linha); }
.bo-acessos-nome {
  position: sticky; left: 0; z-index: 2;
  background: var(--cor-fundo);
  text-align: left; font-weight: 400; white-space: nowrap;
  padding: 7px 14px; min-width: 240px;
  border-right: 1px solid var(--cor-linha);
}
.bo-acessos-col { text-align: center; padding: 7px 14px; min-width: 120px; }
.bo-acessos thead .bo-acessos-col {
  font-weight: 500; color: var(--cor-base); vertical-align: bottom;
  padding-bottom: 10px; white-space: nowrap;
}
.bo-acessos-tudo {
  font-size: 0.6875rem; font-weight: 400; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--cor-texto-secundario);
}
/* A profundidade lê-se pela indentação: módulo, sub-módulo, sub-sub. */
.bo-acessos tbody .bo-acessos-n0 { font-weight: 600; }
.bo-acessos tbody .bo-acessos-n1 { padding-left: 34px; }
.bo-acessos tbody .bo-acessos-n2 { padding-left: 54px; font-size: 0.75rem; opacity: 0.85; }
.bo-acessos tbody tr:hover td, .bo-acessos tbody tr:hover .bo-acessos-nome {
  background: rgba(29,31,36,0.03);
}

/* ---- Mensagem de verificação sem piscar ----
   Com o perfil e os acessos já guardados, o gate resolve-se em poucos
   milissegundos e a mensagem só servia para piscar a cada navegação.
   Fica escondida durante 250ms; se a verificação for mesmo demorada,
   aparece. (Filipe, 18/08/2026.) */
#bo-checking, #ar-loading {
  opacity: 0;
  animation: bygga-mostrar-verificacao 0s 250ms forwards;
}
@keyframes bygga-mostrar-verificacao { to { opacity: 1; } }

/* Com sessão guardada (classe posta por um script inline antes da
   pintura), o painel de login nunca chega a aparecer na raiz. */
html.com-sessao #ar-login-shell { display: none; }





/* ── bygga data ─────────────────────────────────────────────────
   Menu à esquerda, concelhos por cima, mapa ao meio, evolução por
   baixo. As cores dos dados não são as da marca: estão no JavaScript,
   validadas para daltonismo e contraste, porque servem para ler e não
   para assinar. */
.bd-main { padding: calc(52px + 1rem) 1.25rem 1.5rem; max-width: 1680px; margin: 0 auto; }

.bd-quadro { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1rem; }

/* Menu dos indicadores */
.bd-menu {
  border: 1px solid var(--cor-linha); background: #fff;
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 52px - 3rem); position: sticky; top: calc(52px + 1rem);
}
.bd-menu-topo { padding: 0.65rem; border-bottom: 1px solid var(--cor-linha); }
.bd-menu-topo input {
  width: 100%; font: inherit; font-size: 0.8125rem; padding: 0.4rem 0.5rem;
  border: 1px solid var(--cor-linha); border-radius: 0; background: var(--cor-fundo);
}
.bd-menu-lista { overflow-y: auto; padding-bottom: 0.5rem; }
.bd-menu-grupo {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--cor-texto-secundario); padding: 0.8rem 0.75rem 0.3rem;
}
.bd-menu-item {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 0.4rem 0.75rem; cursor: pointer; border-left: 2px solid transparent;
  font: inherit; color: var(--cor-base);
}
.bd-menu-item span { display: block; font-size: 0.8125rem; line-height: 1.25; }
.bd-menu-item small { display: block; font-size: 0.6875rem; color: var(--cor-texto-secundario); }
.bd-menu-item:hover { background: var(--cor-fundo); }
.bd-menu-item.is-ativo { background: var(--cor-fundo); border-left-color: var(--cor-acento); font-weight: 500; }
.bd-menu-vazio { padding: 1rem 0.75rem; font-size: 0.8125rem; color: var(--cor-texto-secundario); }

.bd-coluna { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

/* Concelhos */
.bd-concelhos-caixa { border: 1px solid var(--cor-linha); background: #fff; }
.bd-concelhos-cabeca {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--cor-linha);
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--cor-texto-secundario);
}
.bd-concelhos-acoes button {
  border: 0; background: none; font: inherit; font-size: 0.6875rem; cursor: pointer;
  color: var(--cor-base); text-decoration: underline; padding: 0 0.25rem;
  text-transform: none; letter-spacing: 0;
}
.bd-concelhos { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.65rem 0.75rem; }
.bd-conc {
  display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer;
  font-size: 0.8125rem; padding: 0.25rem 0.55rem;
  border: 1px solid var(--cor-linha); background: #fff; white-space: nowrap;
}
.bd-conc.is-ativo { border-color: var(--cor-base); background: var(--cor-fundo); }
.bd-conc input { accent-color: var(--cor-base); margin: 0; }

/* Mapa */
.bd-mapa-caixa { position: relative; border: 1px solid var(--cor-linha); background: #fff; }
.bd-mapa-cabeca {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--cor-linha);
}
/* Dois grupos de botões no canto do mapa - detalhe e limites de
   referência. Alinhados à direita e um por linha, para não empurrarem o
   título quando o ecrã aperta. */
.bd-mapa-controlos {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem;
}
.bd-mapa-cabeca h1 { font-size: 1.0625rem; font-weight: 600; margin: 0; }
.bd-mapa-cabeca p { margin: 0.1rem 0 0; font-size: 0.75rem; color: var(--cor-texto-secundario); }
#bd-mapa { height: clamp(380px, 62vh, 720px); background: var(--cor-fundo); }
.leaflet-container { font: inherit; background: var(--cor-fundo); }
.leaflet-tooltip {
  border-radius: 0; border: 1px solid var(--cor-linha); font-size: 0.75rem;
  box-shadow: none; color: var(--cor-base);
}
.bd-rotulo-concelho {
  background: none; border: 0; box-shadow: none; padding: 0;
  font-size: 0.6875rem; font-weight: 600; color: var(--cor-base);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.bd-rotulo-concelho::before { display: none; }

.bd-legenda {
  position: absolute; left: 12px; bottom: 12px; z-index: 500;
  background: rgba(255,255,255,0.94); border: 1px solid var(--cor-linha);
  padding: 0.6rem 0.7rem; display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.7rem; color: var(--cor-texto-secundario);
}
.bd-legenda-titulo { color: var(--cor-base); font-weight: 500; margin-bottom: 0.15rem; }
.bd-chave { display: flex; align-items: center; gap: 0.4rem; }
.bd-chave i { width: 14px; height: 14px; display: inline-block; border: 1px solid rgba(0,0,0,0.08); }
.bd-chave-vazia {
  background: #EFEEEB;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 3px,
                    rgba(0,0,0,0.18) 3px, rgba(0,0,0,0.18) 4px);
}

/* Barra entre o mapa e o gráfico */
.bd-barra {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem;
  padding: 0.7rem 0.9rem; border: 1px solid var(--cor-linha); background: #fff;
}
.bd-barra-etiqueta {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--cor-texto-secundario); margin-right: 0.15rem;
}
.bd-grupo { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.bd-grupo button {
  font: inherit; font-size: 0.8125rem; padding: 0.35rem 0.7rem; cursor: pointer;
  border: 1px solid var(--cor-linha); background: #fff; color: var(--cor-base);
}
.bd-grupo button:hover:not(:disabled) { border-color: var(--cor-base); }
.bd-grupo button.is-ativo { background: var(--cor-base); color: #fff; border-color: var(--cor-base); }
.bd-grupo button:disabled { opacity: 0.35; cursor: default; }

.bd-periodo-grupo { display: flex; flex-direction: column; gap: 0.2rem; flex: 1 1 220px; min-width: 180px; }
.bd-periodo-grupo label {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--cor-texto-secundario);
}
.bd-periodo-grupo label strong { color: var(--cor-base); letter-spacing: 0; }
.bd-periodo-grupo input { accent-color: var(--cor-base); width: 100%; }

.bd-exportar-grupo { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; }
.bd-exportar-grupo button {
  font: inherit; font-size: 0.75rem; padding: 0.3rem 0.6rem; cursor: pointer;
  border: 1px solid var(--cor-linha); background: #fff; color: var(--cor-base);
}
.bd-exportar-grupo button:hover:not(:disabled) { border-color: var(--cor-base); }
.bd-exportar-grupo button:disabled { opacity: 0.35; cursor: default; }

.bd-nota { margin: 0.6rem 0 0; font-size: 0.75rem; color: var(--cor-texto-secundario); }
/* A nota do indicador é a primeira por baixo do gráfico e a que mais
   pesa na leitura: fica um pouco mais escura do que as de modo. */
.bd-nota-indicador { color: var(--cor-texto); }

/* Gráfico */
.bd-grafico-caixa { border: 1px solid var(--cor-linha); background: #fff; padding: 0.9rem; }
.bd-grafico-cabeca {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem;
}
.bd-grafico-cabeca h2 { font-size: 0.9375rem; font-weight: 600; margin: 0; }
.bd-series { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
.bd-serie { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: var(--cor-texto-secundario); }
.bd-serie i { width: 10px; height: 10px; display: inline-block; }
#bd-grafico svg { width: 100%; height: auto; display: block; }
.bd-grelha { stroke: #E5E4E0; stroke-width: 1; }
.bd-zero { stroke: #A6A29A; stroke-width: 1; stroke-dasharray: 4 3; }
.bd-agulha { stroke: var(--cor-acento); stroke-width: 1; stroke-dasharray: 3 3; }
.bd-eixo { fill: var(--cor-texto-secundario); font-size: 11px; }
.bd-ponta { fill: var(--cor-base); font-size: 11px; font-weight: 500; }
.bd-vazio { font-size: 0.8125rem; color: var(--cor-texto-secundario); margin: 1.5rem 0; }
.bd-fonte { margin: 0.6rem 0 0; font-size: 0.7rem; color: var(--cor-texto-secundario); }

@media (max-width: 1100px) {
  .bd-quadro { grid-template-columns: 1fr; }
  .bd-menu { position: static; max-height: 320px; }
  .bd-exportar-grupo { margin-left: 0; }
}

/* Âmbito do bygga data - cascata NUTS II → NUTS III → concelho.
   Em <details> nativos: o estado de aberto é do browser e não há JS a
   guardá-lo. A indentação faz o trabalho de mostrar a hierarquia. */
.bd-arvore { border: 1px solid var(--cor-linha); background: #fff; }
.bd-arvore details { border-bottom: 1px solid var(--cor-linha); }
.bd-arvore details:last-child { border-bottom: 0; }
.bd-arvore summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.55rem 0.8rem; cursor: pointer; font-size: 0.875rem;
  list-style: none;
}
.bd-arvore summary::-webkit-details-marker { display: none; }
.bd-arvore summary::before {
  content: '▸'; margin-right: 0.45rem; font-size: 0.75rem;
  color: var(--cor-texto-secundario); flex: 0 0 auto;
}
.bd-arvore details[open] > summary::before { content: '▾'; }
.bd-arvore summary:hover { background: var(--cor-fundo); }
.bd-arvore-n2 > summary { font-weight: 600; }
.bd-arvore-n3 { margin-left: 1.3rem; border-bottom: 0 !important; }
.bd-arvore-n3 > summary { font-size: 0.8125rem; color: var(--cor-texto-secundario); }
.bd-arvore-conta {
  margin-left: auto; font-size: 0.6875rem; font-variant-numeric: tabular-nums;
  color: var(--cor-texto-secundario); white-space: nowrap;
}
.bd-arvore-concelhos {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  padding: 0.2rem 0.8rem 0.7rem 2.5rem;
}
.bd-ambito-conta { font-size: 0.8125rem; color: var(--cor-texto-secundario); }

/* Nomes das NUTS: recessivos, para nomearem a moldura sem competirem
   com os dos concelhos, que são o assunto. */
.bd-rotulo-contexto {
  background: none; border: 0; box-shadow: none; padding: 0;
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.04em;
  text-transform: uppercase; color: #8A8F98; white-space: nowrap;
}
.bd-rotulo-contexto::before { display: none; }
.bd-rotulo-contexto { cursor: pointer; pointer-events: auto; }
.bd-rotulo-contexto:hover { color: var(--cor-base); }
.bd-rotulo-contexto.is-escolhida {
  color: var(--cor-base); font-weight: 700;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
