.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--gold-500);
  color: var(--navy-900);
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-text {
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
}

.brand-text__name {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: inherit;
}

.brand-text__name span { font-weight: 300; }

.brand-text__tag {
  display: block;
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.14);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--control-h);
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast),
    color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--navy-800);
  color: var(--text-invert);
  box-shadow: var(--sh-sm);
}
.btn--primary:hover { background: var(--navy-700); }

.btn--accent {
  background: var(--gold-500);
  color: var(--navy-900);
  box-shadow: var(--sh-sm);
}
.btn--accent:hover { background: var(--gold-400); }

.btn--outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--navy-800);
}
.btn--outline:hover {
  border-color: var(--navy-500);
  background: var(--navy-050);
}

.btn--ghost {
  background: transparent;
  color: var(--grey-600);
}
.btn--ghost:hover {
  background: var(--grey-100);
  color: var(--navy-800);
}

.btn--danger {
  background: var(--state-late-bg);
  color: var(--state-late);
}
.btn--danger:hover { background: #fadada; }

.btn--warning {
  background: var(--prio-mid-bg);
  color: var(--prio-mid);
}
.btn--warning:hover { background: #fbe7bf; }

.btn--danger-solid {
  background: var(--state-late);
  color: var(--white);
}
.btn--danger-solid:hover { background: #c24541; }

.btn--sm { height: 30px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn--block { width: 100%; }

/* Botão "de escolha" (duas opções lado a lado num modal, cada uma com
   título + descrição) — estava repetido com style inline idêntico em
   3 modais (kitchen-fichas-tecnicas.html, kitchen-menus.html x2), com
   risco de um dia ficarem dessincronizados. Passa a uma classe única. */
.btn-choice {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  justify-content: flex-start;
  text-align: left;
  height: auto;
  padding: var(--sp-3) var(--sp-4);
  white-space: normal;
}

.btn-choice__label {
  display: block;
  font-weight: 700;
}

.btn-choice__desc {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 400;
  margin-top: 2px;
  color: var(--text-muted);
}

.btn--primary .btn-choice__desc { color: var(--white); opacity: 0.85; }

.btn-icon {
  display: grid;
  place-items: center;
  width: var(--control-h);
  height: var(--control-h);
  flex-shrink: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--grey-500);
  transition: background var(--t-fast), color var(--t-fast),
    border-color var(--t-fast);
}

.btn-icon:hover {
  background: var(--navy-050);
  border-color: var(--navy-100);
  color: var(--navy-700);
}

.btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-icon--bare {
  border-color: transparent;
  background: transparent;
  width: 30px;
  height: 30px;
}
.btn-icon--bare:hover { background: var(--grey-100); }

.btn-icon--primary {
  border-radius: var(--r-full);
  border-color: transparent;
  background: var(--navy-800);
  color: var(--white);
}
.btn-icon--primary:hover { background: var(--navy-700); }

.panel__header.panel__header--brand {
  background: var(--navy-800);
}
.panel__header--brand .panel__title { color: var(--white); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--grey-600);
}

.field__hint {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

.field-warning {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--prio-mid-bg);
  border: 1px solid var(--gold-400);
  border-radius: var(--r-md);
  color: var(--prio-mid);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.4;
}

.field-warning .icon {
  flex-shrink: 0;
  color: var(--prio-mid);
}

.input,
.select {
  height: var(--control-h);
  width: 100%;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--fs-md);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.input::placeholder { color: var(--grey-400); }

.input:hover,
.select:hover { border-color: var(--grey-400); }

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--navy-500);
  box-shadow: 0 0 0 3px rgba(43, 84, 144, 0.12);
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

input[type="checkbox"]::before {
  content: "";
  width: 11px;
  height: 11px;
  transform: scale(0);
  transition: transform var(--t-fast);
  background: var(--white);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:hover { border-color: var(--navy-500); }

input[type="checkbox"]:checked {
  background: var(--navy-800);
  border-color: var(--navy-800);
}

input[type="checkbox"]:checked::before { transform: scale(1); }

input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(43, 84, 144, 0.2);
}

input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input[type="date"],
.input[type="time"],
.input[type="month"] {
  color-scheme: light;
}

/* Chrome/Safari desenham o widget nativo de data/hora com a sua própria
   altura e fundo (branco, mais alto que os outros campos), ignorando
   parcialmente o background/height do .input — "appearance: none" faz o
   browser deixar de o desenhar como controlo nativo e passar a respeitar
   por completo o estilo do .input, sem perder o ícone/seletor de
   calendário (que continua interativo). */
.input[type="date"],
.input[type="time"],
.input[type="month"] {
  appearance: none;
  -webkit-appearance: none;
}

.input[type="date"]::-webkit-datetime-edit,
.input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.input[type="date"]::-webkit-datetime-edit-text,
.input[type="date"]::-webkit-datetime-edit-day-field,
.input[type="date"]::-webkit-datetime-edit-month-field,
.input[type="date"]::-webkit-datetime-edit-year-field,
.input[type="time"]::-webkit-datetime-edit,
.input[type="time"]::-webkit-datetime-edit-fields-wrapper,
.input[type="time"]::-webkit-datetime-edit-text,
.input[type="time"]::-webkit-datetime-edit-hour-field,
.input[type="time"]::-webkit-datetime-edit-minute-field,
.input[type="time"]::-webkit-datetime-edit-ampm-field,
.input[type="month"]::-webkit-datetime-edit,
.input[type="month"]::-webkit-datetime-edit-fields-wrapper,
.input[type="month"]::-webkit-datetime-edit-text,
.input[type="month"]::-webkit-datetime-edit-month-field,
.input[type="month"]::-webkit-datetime-edit-year-field {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.input[type="date"]::-webkit-calendar-picker-indicator,
.input[type="month"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
  border-radius: var(--r-sm);
  padding: 3px;
  transition: opacity var(--t-fast);
}

.input[type="month"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* O ícone nativo do input[type=time] (::-webkit-calendar-picker-indicator)
   só existe em navegadores WebKit/Chromium e não aceita cor — em Safari
   fica sempre a preto sólido, por isso qualquer ajuste de opacidade/estilo
   feito só nesse pseudo-elemento passava despercebido. Em vez disso
   escondemos o ícone nativo (mas mantemos a área clicável, que continua a
   abrir o seletor de horas) e desenhamos o nosso próprio ícone, na cor da
   marca, como background-image do próprio input — funciona de forma
   idêntica em qualquer navegador. */
.input[type="time"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b5490' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15 14.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  background-size: 18px 18px;
  padding-right: calc(var(--sp-3) * 2 + 18px);
}

.input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
}

.input[type="time"]:hover {
  background-color: rgba(43, 84, 144, 0.05);
}

.date-field {
  position: relative;
}

.date-field__native {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.date-field__trigger {
  height: var(--control-h);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font: inherit;
  font-size: var(--fs-md);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.date-field__trigger:hover { border-color: var(--grey-400); }

.date-field__trigger.is-open,
.date-field__trigger:focus-visible {
  outline: none;
  border-color: var(--navy-500);
  box-shadow: 0 0 0 3px rgba(43, 84, 144, 0.12);
}

.date-field__trigger:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.date-field__value[data-empty="true"] { color: var(--grey-400); }

.date-field__icon { color: var(--grey-500); flex-shrink: 0; }

.date-field__panel {
  position: fixed;
  z-index: 1000;
  width: 280px;
  padding: var(--sp-3);
  border-radius: var(--r-lg);
  border: 1px solid var(--grey-200);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  animation: date-field-in var(--t-fast) ease;
}

@keyframes date-field-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.date-field__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

/* O título é um botão: clicar sobe de dias para meses e de meses para anos. */
.date-field__month {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px var(--sp-2);
  border: none;
  border-radius: var(--r-md);
  background: transparent;
  font: inherit;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast);
}

.date-field__month::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.6;
}

.date-field__month:hover:not(:disabled) { background: var(--grey-100); }
.date-field__month:disabled { cursor: default; }
.date-field__month:disabled::after { display: none; }
.date-field__month:focus-visible,
.date-field__nav:focus-visible,
.date-field__cell:focus-visible,
.date-field__day:focus-visible { outline: 2px solid var(--navy-500); outline-offset: 1px; }

.date-field__nav {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}

.date-field__nav:hover { background: var(--grey-100); color: var(--navy-700); }

.date-field__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: var(--sp-1);
}

.date-field__weekdays span {
  display: grid;
  place-items: center;
  height: 26px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--grey-400);
  text-transform: uppercase;
}

.date-field__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.date-field__day {
  height: 32px;
  border: none;
  border-radius: var(--r-full);
  background: transparent;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}

.date-field__day--blank { cursor: default; }

/* Grelha de meses / anos (3 colunas, 4 linhas) */
.date-field__grid--picker {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 46px;
  gap: 6px;
  min-height: 232px;
  align-content: start;
}

.date-field__cell {
  border: none;
  border-radius: var(--r-md);
  background: transparent;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}

.date-field__cell:hover { background: var(--grey-100); }

.date-field__day:not(.date-field__day--blank):hover { background: var(--grey-100); }

.date-field__day--today {
  font-weight: 700;
  color: var(--navy-700);
  box-shadow: inset 0 0 0 1px var(--navy-500);
}

.date-field__day--selected,
.date-field__day--selected:hover {
  background: var(--navy-700);
  color: var(--white);
  font-weight: 700;
}

.date-field__panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--grey-200);
}

.date-field__today,
.date-field__clear {
  border: none;
  background: transparent;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--navy-600);
  cursor: pointer;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}

.date-field__clear { color: var(--text-muted); }

.date-field__today:hover,
.date-field__clear:hover { background: var(--grey-100); }

/* Seletor de hora estilo relógio da Apple (assets/js/core/time-picker.js):
   duas rodas com scroll para horas e minutos. */
.time-field__panel { width: 220px; }

.time-field__wheels {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 180px;
}

.time-field__band {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 36px;
  transform: translateY(-50%);
  border-radius: var(--r-md);
  background: rgba(120, 120, 128, 0.14);
  pointer-events: none;
}

.time-field__wheel {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 100%;
  overflow-y: auto;
  padding: 72px 0;
  box-sizing: border-box;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
}

.time-field__wheel::-webkit-scrollbar { display: none; }

.time-field__item {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: var(--fs-lg, 1.125rem);
  font-variant-numeric: tabular-nums;
  color: var(--grey-400);
  cursor: pointer;
  user-select: none;
  transition: color var(--t-fast);
}

.time-field__item.is-near { color: var(--grey-500); }

.time-field__item.is-selected {
  color: var(--text);
  font-weight: 700;
  font-size: 1.375rem;
}

.time-field__colon {
  position: relative;
  z-index: 1;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
}

.select {
  appearance: none;
  padding-right: var(--sp-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7789' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  background-size: 16px;
  cursor: pointer;
}

.textarea {
  width: 100%;
  min-height: 96px;
  padding: var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--fs-md);
  resize: vertical;
}

.textarea:focus {
  outline: none;
  border-color: var(--navy-500);
  box-shadow: 0 0 0 3px rgba(43, 84, 144, 0.12);
}

.search {
  position: relative;
  display: block;
  min-width: 0;
}

.search .icon {
  position: absolute;
  top: 50%;
  left: var(--sp-3);
  transform: translateY(-50%);
  color: var(--grey-400);
  pointer-events: none;
}

.search .input { padding-left: calc(var(--sp-3) * 2 + 18px); }

.field-inline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--control-h);
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--grey-500);
  transition: border-color var(--t-fast);
}

.field-inline:focus-within {
  border-color: var(--navy-500);
  box-shadow: 0 0 0 3px rgba(43, 84, 144, 0.12);
}

.field-inline .select,
.field-inline .input {
  height: 100%;
  border: none;
  padding: 0;
  background-color: transparent;
  box-shadow: none;
  font-weight: 600;
  color: var(--navy-800);
  min-width: 130px;
}

.field-inline .select { padding-right: var(--sp-5); }

.field-inline .select:focus,
.field-inline .input:focus { box-shadow: none; }

.field-inline .date-field { height: 100%; flex: 1 1 auto; min-width: 130px; }

.field-inline .date-field__trigger {
  height: 100%;
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-weight: 600;
  color: var(--navy-800);
}

.field-inline .date-field__trigger.is-open,
.field-inline .date-field__trigger:focus-visible { box-shadow: none; }

.field-inline--static {
  cursor: default;
}

.field-inline--static span {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--navy-800);
  white-space: nowrap;
}

.lang-switcher {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  box-shadow: var(--sh-sm);
}

.lang-switcher__option {
  padding: 6px 11px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--grey-500);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}

.lang-switcher__option:hover { color: var(--navy-700); }

.lang-switcher__option.is-active {
  background: var(--navy-800);
  color: var(--white);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

.card__body { padding: var(--sp-4); }

.panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}

.panel__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 50px;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.panel__header .icon { color: var(--navy-600); }
.panel__header--brand .icon { color: var(--white); }

.panel__title {
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel__meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.panel__body {
  flex: 1;
  padding: var(--sp-4);
}

.panel__body--flush { padding: 0; }

.panel__footer {
  padding: var(--sp-2) var(--sp-4);
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.panel--accent-danger { border-top: 3px solid var(--state-late); }
.panel--accent-success { border-top: 3px solid var(--state-done); }
.panel--accent-navy { border-top: 3px solid var(--navy-600); }

/* Quando um .panel é o único conteúdo dentro de .app__content (que é
   quem deve dar scroll à página), o overflow:hidden do .panel torna o
   seu min-height automático 0 enquanto item flex — o browser passa a
   poder encolhê-lo abaixo do conteúdo, que fica cortado pelo próprio
   overflow:hidden em vez de a página fazer scroll. flex-shrink:0
   obriga o .panel a manter a altura do conteúdo, devolvendo o scroll
   ao .app__content, como esperado. */
.panel--grow { flex-shrink: 0; }

.stat {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}

.stat:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--stat-color, var(--navy-600));
}

.stat__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  background: var(--stat-bg, var(--navy-100));
  color: var(--stat-color, var(--navy-600));
}

.stat__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-500);
}

.stat__value {
  font-size: var(--fs-2xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--navy-800);
}

.stat__hint {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.stat--pending { --stat-color: var(--state-pending); --stat-bg: var(--state-pending-bg); }
.stat--progress { --stat-color: var(--state-progress); --stat-bg: var(--state-progress-bg); }
.stat--done { --stat-color: var(--state-done); --stat-bg: var(--state-done-bg); }
.stat--late { --stat-color: var(--state-late); --stat-bg: var(--state-late-bg); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: currentColor;
}

.badge--neutral { background: var(--state-pending-bg); color: var(--state-pending); }
.badge--info { background: var(--state-progress-bg); color: var(--state-progress); }
.badge--success { background: var(--state-done-bg); color: var(--state-done); }
.badge--danger { background: var(--state-late-bg); color: var(--state-late); }
.badge--warning { background: var(--prio-mid-bg); color: var(--prio-mid); }

.badge--external {
  background: var(--grey-100);
  color: var(--grey-600);
  font-size: var(--fs-xs);
  padding: 3px 8px;
}

.prio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.prio--low { background: var(--prio-low-bg); color: var(--prio-low); }
.prio--mid { background: var(--prio-mid-bg); color: var(--prio-mid); }
.prio--high { background: var(--prio-high-bg); color: var(--prio-high); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--grey-100);
  color: var(--grey-600);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;

  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255, 255, 255, 0)) 0 0,
    linear-gradient(to right, rgba(255, 255, 255, 0), var(--surface) 70%) 100% 0,
    linear-gradient(to right, rgba(15, 37, 71, 0.12), rgba(15, 37, 71, 0)) 0 0,
    linear-gradient(to left, rgba(15, 37, 71, 0.12), rgba(15, 37, 71, 0)) 100% 0;
  background-repeat: no-repeat;
  background-color: var(--surface);
  background-size: 32px 100%, 32px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
}

.table-wrap--scroll {
  max-height: 205px;
  overflow-y: auto;
}

.table {
  min-width: 720px;
  font-size: var(--fs-md);
}

.table--compact { min-width: 440px; }

@media (max-width: 640px) {

  .table tbody td { padding: var(--sp-4); }
}

.table thead th {
  position: sticky;
  top: 0;
  padding: var(--sp-2) var(--sp-4);
  background: var(--navy-050);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-600);
  text-align: left;
  white-space: nowrap;
}

.table tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--grey-100);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr {
  transition: background var(--t-fast);
}

.table tbody tr:hover { background: var(--navy-050); }

.table__cell-title {
  font-weight: 600;
  color: var(--navy-800);
}

.table__cell-sub {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.table__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1);
}

.col-actions { width: 1%; text-align: right; }
.col-tight { width: 1%; white-space: nowrap; }

.item-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 160px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: var(--sp-1);
}

.item-list.is-empty,
.agenda.is-empty {
  max-height: none;
  overflow: visible;
}

.item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--item-accent, var(--navy-600));
  border-radius: var(--r-md);
  background: var(--surface);
  transition: box-shadow var(--t-fast), border-color var(--t-fast);
}

.item:hover { box-shadow: var(--sh-sm); }

.item--danger { --item-accent: var(--state-late); }
.item--warning { --item-accent: var(--gold-500); }
.item--info { --item-accent: var(--state-progress); }

.item--prio-low { --item-accent: var(--prio-low); }
.item--prio-mid { --item-accent: var(--prio-mid); }
.item--prio-high { --item-accent: var(--prio-high); }

.item__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--grey-100);
  color: var(--grey-600);
}

.item__body { min-width: 0; flex: 1; }

.item__title {
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item__meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item > .prio,
.item > .btn-icon {
  flex-shrink: 0;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 140px;
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  color: var(--text-muted);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: var(--grey-100);
  color: var(--grey-400);
  margin-bottom: var(--sp-1);
}

.empty__title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--grey-600);
}

.empty__text {
  font-size: var(--fs-md);
  max-width: 34ch;
}

.meter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meter__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--fs-md);
}

.meter__label { font-weight: 600; }

.meter__value {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 600;
}

.meter__track {
  height: 8px;
  border-radius: var(--r-full);
  background: var(--grey-100);
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--meter-color, var(--navy-600));
  transition: width 600ms var(--ease);
}

.meter--low { --meter-color: var(--prio-low); }
.meter--mid { --meter-color: var(--prio-mid); }
.meter--high { --meter-color: var(--prio-high); }

.filters {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  flex-wrap: wrap;
}

.filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--sp-4);

  flex: 1 1 520px;
  min-width: 0;
}

.filters__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
  margin-left: auto;
  padding-bottom: 1px;
}

@media (max-width: 640px) {

  .filters { flex-direction: column; align-items: stretch; }
  .filters__grid { grid-template-columns: minmax(0, 1fr); flex-basis: auto; }
  .filters__actions { margin-left: 0; width: 100%; }
  .filters__actions .btn { flex: 1; }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  background: rgba(10, 26, 51, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med);
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal__dialog {
  width: min(620px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
    overflow: hidden;
  box-shadow: var(--sh-lg);
  transform: translateY(12px) scale(0.98);
  transition: transform var(--t-med);
}

.modal.is-open .modal__dialog { transform: none; }

.modal__dialog--sm { width: min(440px, 100%); }
.modal__dialog--lg { width: min(760px, 100%); }

.modal__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.modal__header--brand {
  background: var(--navy-800);
  border-bottom-color: var(--navy-800);
}
.modal__header--brand .modal__title { color: var(--white); }
.modal__header--brand .icon { color: var(--white); }
.modal__header--brand .modal__close { color: rgba(255, 255, 255, 0.7); }
.modal__header--brand .modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.modal__header--danger {
  background: var(--navy-800);
  border-bottom-color: var(--state-late);
}
.modal__header--success {
  background: var(--navy-800);
  border-bottom-color: var(--state-done);
}
.modal__header--danger .modal__title,
.modal__header--success .modal__title { color: var(--white); }
.modal__header--danger .modal__close,
.modal__header--success .modal__close { color: rgba(255, 255, 255, 0.7); }
.modal__header--danger .modal__close:hover,
.modal__header--success .modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.modal__title {
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modal__close { margin-left: auto; }

/* .modal__dialog é flex column com max-height: 90vh; sem "flex" + "min-height: 0"
   aqui e no <form> que às vezes envolve corpo + rodapé, um conteúdo mais alto
   (ex.: o modo "Externo" do popup de colaborador) empurra o rodapé (botões)
   para fora dos 90vh e o "overflow: hidden" do dialog corta-o. */
.modal__dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.modal__body {
  padding: var(--sp-5);
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal__body::-webkit-scrollbar { display: none; }

.modal__body .field--full { grid-column: 1 / -1; }

.modal__body > .modal__footer--form {
  grid-column: 1 / -1;
}

.modal__body--form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.modal__row {
  display: grid;
  gap: var(--sp-4);
}

.modal__row--title { grid-template-columns: 1.6fr 1fr 1fr; }
.modal__row--desc { grid-template-columns: 1.5fr 1fr; align-items: start; }
.modal__row--even { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.modal__error {
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--state-late-bg);
  color: var(--state-late);
  font-size: var(--fs-md);
  font-weight: 600;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.modal__footer--form {
  margin: 0 calc(var(--sp-5) * -1) calc(var(--sp-5) * -1);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

@media (max-width: 640px) {
  .modal__body { grid-template-columns: minmax(0, 1fr); }
  .modal__row--title,
  .modal__row--desc,
  .modal__row--even { grid-template-columns: minmax(0, 1fr); }

    .modal { padding: var(--sp-4); }

  .modal__dialog,
  .modal__dialog--sm,
  .modal__dialog--lg,
  .print-labels-dialog {
    width: 90vw;
    max-width: 90vw;
    max-height: 90vh;
  }

  .modal__footer,
  .modal__footer--form {
    padding-bottom: max(var(--sp-4), env(safe-area-inset-bottom));
  }

    .btn-icon { min-width: 40px; min-height: 40px; }
  .btn { min-height: 44px; }
}

.modal__body--single {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.type-picker__intro {
  font-size: var(--fs-md);
  color: var(--text-muted);
}

.type-picker {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.type-picker__option {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: left;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.type-picker__option:hover {
  border-color: var(--navy-400, var(--navy-500));
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}

.type-picker__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--r-md);
}

.type-picker__icon--danger { background: var(--state-late-bg); color: var(--state-late); }
.type-picker__icon--success { background: var(--state-done-bg); color: var(--state-done); }

.type-picker__name {
  display: block;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--navy-800);
}

.type-picker__desc {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.priority-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
}

.priority-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--grey-500);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.priority-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.priority-pill:has(input:checked) {
  color: var(--pill-color);
  background: var(--pill-bg);
  border-color: var(--pill-color);
}

.priority-pill--low { --pill-color: var(--prio-low); --pill-bg: var(--prio-low-bg); }
.priority-pill--mid { --pill-color: var(--prio-mid); --pill-bg: var(--prio-mid-bg); }
.priority-pill--high { --pill-color: var(--prio-high); --pill-bg: var(--prio-high-bg); }

.priority-pill:hover { border-color: var(--pill-color); }

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
}

.upload-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 96px;
  padding: var(--sp-3);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  color: var(--grey-400);
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

/* Ao passar o rato, a zona destaca-se para mostrar que se clica ali. As
   páginas com regra própria de :hover mantêm-na (vêm depois, mesmo peso);
   um slot já com ficheiro (.has-image) fica com o seu verde. */
.upload-slot:where(:not(.has-image)):hover {
  border-color: var(--g-accent, #0a84ff);
  color: var(--g-accent, #0a84ff);
  background: var(--g-accent-soft, rgba(10, 132, 255, 0.12));
}

/* Um só botão por slot — ao carregar, abre um popup pequeno com "Câmara"
   ou "Ficheiros", em vez de depender de um único <input type=file> cujo
   comportamento varia consoante o telemóvel/browser (nalguns Android só
   abria o gestor de ficheiros, sem opção de câmara). */
.upload-slot__trigger {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: center;
}

/* O botão cobre o slot inteiro (também a margem à volta do texto), para o
   clique funcionar em toda a zona que se destaca. */
.upload-slot__trigger::after {
  content: "";
  position: absolute;
  inset: 0;
}

.upload-slot__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
}

.upload-slot__menu[hidden] {
  display: none;
}

.upload-slot__menu-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: none;
  border: none;
  border-bottom: 1px solid var(--grey-100);
  text-align: left;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--navy-800);
  cursor: pointer;
}

.upload-slot__menu-item:last-child {
  border-bottom: none;
}

.upload-slot__menu-item:hover,
.upload-slot__menu-item:focus-visible {
  background: var(--navy-050);
}

.upload-slot__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-full);
  background: var(--state-late);
  color: var(--white);
  box-shadow: var(--sh-sm);
  transition: background var(--t-fast), transform var(--t-fast);
}

.upload-slot__remove:hover {
  background: #c24541;
  transform: scale(1.08);
}

.upload-slot__remove .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}


.upload-slot.has-image {
  border-style: solid;
  border-color: var(--state-done);
  color: var(--state-done);
  background: var(--state-done-bg);
}

.upload-slot__thumb {
  width: 100%;
  height: 56px;
  border-radius: var(--r-sm);
  object-fit: cover;
}

@media (max-width: 640px) {
  .upload-grid { grid-template-columns: minmax(0, 1fr); }
}

.tabs {
  display: flex;
  align-self: flex-start;
  gap: var(--sp-1);
  padding: var(--sp-1);
  background: var(--grey-100);
  border-radius: var(--r-md);
}

.tab {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--grey-500);
  transition: background var(--t-fast), color var(--t-fast);
}

.tab:hover { color: var(--navy-800); }

.tab.is-active {
  background: var(--surface);
  color: var(--navy-800);
  box-shadow: var(--sh-xs);
}

[data-tip] { position: relative; }

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: var(--navy-900);
  color: var(--white);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
  z-index: 40;
}

[data-tip]:hover::after { opacity: 1; }

.topbar__actions [data-tip]::after {
  left: auto;
  right: 0;
  top: calc(100% + 8px);
  bottom: auto;
  transform: none;
}

.ai-chat {
  --ac-ink: #1d1d1f;
  --ac-secondary: #6e6e73;
  --ac-accent: #0a84ff;
  --ac-accent-soft: rgba(10, 132, 255, 0.12);
  --ac-glass-bg-strong: rgba(255, 255, 255, 0.86);
  --ac-glass-border: rgba(255, 255, 255, 0.85);
  --ac-hairline: rgba(60, 60, 67, 0.1);
  position: fixed;
  top: 50%;
  right: 24px;
  z-index: 500;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", var(--font-sans);
}

/* Uma janela aberta a partir do chat (ex.: rever a ficha proposta) fica por cima dele;
   com o chat por cima, o painel tapava o botão de confirmar. */
body:has(.modal.is-open) .ai-chat { z-index: 50; }

.ai-chat__fab {
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  border: none;
  background: linear-gradient(155deg, rgba(10, 132, 255, 0.95), rgba(0, 90, 220, 0.95));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 8px 24px -6px rgba(10, 132, 255, 0.5);
  touch-action: none;
  user-select: none;
}

.ai-chat__fab:active {
  cursor: grabbing;
}

.ai-chat__fab:hover {
  filter: brightness(1.08);
}

.ai-chat__fab .icon {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.ai-chat__panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(380px, calc(100vw - 48px));
  height: min(520px, calc(100vh - 48px));
  background: var(--ac-glass-bg-strong);
  border: 1px solid var(--ac-glass-border);
  border-radius: 24px;
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 20px 50px -20px rgba(20, 30, 60, 0.35);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.ai-chat__panel.is-open {
  display: flex;
}

.ai-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--ac-hairline);
  color: var(--ac-ink);
  cursor: default;
  flex-shrink: 0;
}

.ai-chat__header-info {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.ai-chat__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: linear-gradient(155deg, rgba(10, 132, 255, 0.95), rgba(0, 90, 220, 0.95));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--fs-xs);
  flex-shrink: 0;
}

.ai-chat__title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ac-ink);
}

.ai-chat__subtitle {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--ac-secondary);
}

.ai-chat__header .btn-icon {
  color: var(--ac-secondary);
}
.ai-chat__header .btn-icon:hover {
  background: rgba(120, 120, 128, 0.12);
  color: var(--ac-ink);
}

.ai-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.ai-chat__msg {
  max-width: 85%;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.5;
  white-space: pre-wrap;
  text-align: justify;
}

.ai-chat__msg strong {
  font-weight: 700;
}

.ai-chat__msg em {
  font-style: italic;
}

.ai-chat__msg--assistant {
  align-self: flex-start;
  background: rgba(120, 120, 128, 0.08);
  color: var(--ac-ink);
  border-bottom-left-radius: 4px;
}

.ai-chat__msg--user {
  align-self: flex-end;
  background: linear-gradient(155deg, rgba(10, 132, 255, 0.95), rgba(0, 90, 220, 0.95));
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.ai-chat__msg--loading {
  align-self: flex-start;
  color: var(--ac-secondary);
  font-style: italic;
}

.ai-chat__form {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-top: 1px solid var(--ac-hairline);
  flex-shrink: 0;
}

.ai-chat__input {
  flex: 1;
  resize: none;
  max-height: 96px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--ac-hairline);
  border-radius: 18px;
  background: rgba(120, 120, 128, 0.08);
  color: var(--ac-ink);
  font-family: inherit;
  font-size: var(--fs-sm);
}
.ai-chat__input:focus {
  outline: none;
  border-color: var(--ac-accent);
  box-shadow: 0 0 0 3px var(--ac-accent-soft);
}

.ai-chat__send {
  background: linear-gradient(155deg, rgba(10, 132, 255, 0.95), rgba(0, 90, 220, 0.95));
  color: var(--white);
  flex-shrink: 0;
}

.ai-chat__mic {
  flex-shrink: 0;
  color: var(--ac-secondary);
  transition: background var(--t-fast), color var(--t-fast);
}
.ai-chat__mic.is-active {
  background: #fdecea;
  color: #c0392b;
}
.ai-chat__mic.is-listening {
  animation: ai-chat-mic-pulse 1.4s ease-in-out infinite;
}
@keyframes ai-chat-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(192, 57, 43, 0); }
}

.ai-consent-gate {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  overflow-y: auto;
}

.ai-consent-gate__card {
  max-width: 560px;
  width: 100%;
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  padding: var(--sp-6);
}

.ai-consent-gate__title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--navy-800);
  margin-bottom: var(--sp-4);
}

.ai-consent-gate__body {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: var(--fs-base);
  text-align: justify;
}

.ai-consent-gate__body a {
  color: var(--navy-700);
  text-decoration: underline;
}

.ai-consent-gate__note {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-top: var(--sp-4);
}

.ai-consent-gate__actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  margin-top: var(--sp-5);
}

/* Nota: a posição fixa do separador e do painel vive nos próprios
   .team-chat__tab / .team-chat__panel (não neste wrapper) — um
   ancestral com "transform" torna-se o containing block dos seus
   descendentes "position: fixed", o que desalinhava o painel e
   escondia o fundo atrás do conteúdo da página. */
.team-chat {
  --tc-ink: #1d1d1f;
  --tc-ink-soft: #3a3a3c;
  --tc-secondary: #6e6e73;
  --tc-tertiary: #8e8e93;
  --tc-accent: #0a84ff;
  --tc-accent-soft: rgba(10, 132, 255, 0.12);
  --tc-danger: #ff3b30;
  --tc-glass-bg: rgba(255, 255, 255, 0.6);
  --tc-glass-bg-strong: rgba(255, 255, 255, 0.86);
  --tc-glass-border: rgba(255, 255, 255, 0.85);
  --tc-hairline: rgba(60, 60, 67, 0.1);
  position: static;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", var(--font-sans);
}

.team-chat__tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 550;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-right: none;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(155deg, rgba(10, 132, 255, 0.95), rgba(0, 90, 220, 0.95));
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 8px 24px -6px rgba(10, 132, 255, 0.5);
}

/* Em ecrãs de desktop (mesmo ponto de quebra do layout.css onde a
   sidebar deixa de colapsar), o separador fica antes ancorado ao
   canto inferior direito do que a meio da lateral. */
@media (min-width: 769px) {
  .team-chat__tab {
    top: auto;
    bottom: var(--sp-6);
    transform: none;
  }
}

.team-chat__tab:hover {
  filter: brightness(1.08);
}

.team-chat__tab .icon {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

/* Seta no separador lateral; nas páginas móveis (glass.css) o separador
   passa a botão redondo e mostra antes o balão de conversa. */
.team-chat__tab-icon {
  display: inline-flex;
  pointer-events: none;
}

.team-chat__tab-icon--bubble { display: none; }

.team-chat__badge {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--state-late);
  color: var(--white);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-chat__panel {
  position: fixed;
  top: var(--sp-6);
  right: 0;
  bottom: var(--sp-6);
  z-index: 551;
  width: min(360px, calc(100vw - 40px));
  background: var(--tc-glass-bg-strong);
  border: 1px solid var(--tc-glass-border);
  border-right: none;
  border-radius: 24px 0 0 24px;
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 20px 50px -20px rgba(20, 30, 60, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--t-fast);
}

.team-chat__panel.is-open {
  transform: translateX(0);
}

.team-chat__header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--tc-hairline);
  color: var(--tc-ink);
  flex-shrink: 0;
}

.team-chat__header .btn-icon {
  color: var(--tc-secondary);
}
.team-chat__header .btn-icon:hover {
  background: rgba(120, 120, 128, 0.12);
  color: var(--tc-ink);
}

/* Alguns Safari/iOS não resolvem o stroke:currentColor do .icon de forma
   fiável só por herança através do <button> — a cor ao lado fica certa,
   mas o SVG não. Definir a cor diretamente no próprio ícone, em vez de
   confiar só na herança. */
.team-chat__header .btn-icon .icon {
  color: var(--tc-secondary);
  stroke: var(--tc-secondary);
}

.team-chat__header .btn-icon.is-active {
  color: var(--tc-accent);
}

.team-chat__header .btn-icon.is-active .icon {
  color: var(--tc-accent);
  stroke: var(--tc-accent);
}

.team-chat__title {
  flex: 1;
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--tc-ink);
}

.team-chat__header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.team-chat__notice {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  overflow-y: auto;
}

.team-chat__notice[hidden] {
  display: none;
}

.team-chat__notice-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--tc-glass-border);
  border-radius: 24px;
  box-shadow: var(--sh-lg);
  padding: var(--sp-5);
}

.team-chat__notice-title {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--tc-ink);
  margin-bottom: var(--sp-3);
}

.team-chat__notice-body {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: var(--fs-sm);
  text-align: justify;
}

.team-chat__notice-body p {
  margin: 0 0 var(--sp-3);
}

.team-chat__notice-body p:last-child {
  margin-bottom: 0;
}

.team-chat__notice-actions {
  margin-top: var(--sp-4);
}

.team-chat__notice-btn {
  width: 100%;
}

.team-chat__view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.team-chat__view[hidden] {
  display: none;
}

.team-chat__list {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2);
}

.team-chat__empty {
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.team-chat__conv {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-2);
  border: none;
  background: none;
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.team-chat__conv:hover {
  background: rgba(120, 120, 128, 0.08);
}

.team-chat__conv-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: var(--r-full);
  background: linear-gradient(155deg, #ffb35c, #ff7a1a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 800;
}

.team-chat__conv-body {
  flex: 1;
  min-width: 0;
}

.team-chat__conv-name {
  display: block;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--tc-ink);
}

.team-chat__conv-preview {
  display: block;
  font-size: var(--fs-xs);
  color: var(--tc-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.team-chat__conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.team-chat__conv-time {
  font-size: 10.5px;
  color: var(--tc-tertiary);
}

.team-chat__conv-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--tc-accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-chat__conv--pinned {
  border-bottom: 1px solid var(--tc-hairline);
  border-radius: 0;
  margin-bottom: var(--sp-2);
  padding: var(--sp-3) calc(var(--sp-2) * 2);
}

.team-chat__conv-avatar--notif {
  background: linear-gradient(155deg, rgba(10, 132, 255, 0.95), rgba(0, 90, 220, 0.95));
  color: #fff;
}

.team-chat__conv-avatar--notif .icon {
  width: 16px;
  height: 16px;
}

[data-team-chat-notifications-badge] {
  background: var(--danger-500, #e5484d);
  color: var(--white);
}

.team-chat__notifications-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.team-chat__notification {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-3);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--tc-hairline);
}

a.team-chat__notification:hover {
  background: rgba(120, 120, 128, 0.08);
}

.team-chat__notification--unread {
  background: var(--tc-accent-soft);
}

.team-chat__notification-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--tc-ink);
}

.team-chat__notification-body {
  font-size: var(--fs-sm);
  color: var(--tc-secondary);
}

.team-chat__notification-time {
  font-size: 10.5px;
  color: var(--tc-tertiary);
  margin-top: 2px;
}

/* Notificação de denúncia: é um botão (abre a vista da denúncia no chat),
   por isso tira-se o aspeto nativo e fica igual às outras notificações. */
.team-chat__notification--action {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--tc-hairline);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.team-chat__notification--action.team-chat__notification--unread {
  background: var(--tc-accent-soft);
}

.team-chat__notification--action:hover {
  background: rgba(120, 120, 128, 0.08);
}

/* Vista de uma denúncia (só a Administração chega aqui) */
.team-chat__report {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-3);
  overflow-y: auto;
}

.team-chat__report-hint,
.team-chat__report-outcome {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--tc-secondary);
}

.team-chat__report-card {
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: rgba(120, 120, 128, 0.08);
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--tc-ink);
}

.team-chat__report-actions {
  display: flex;
  gap: var(--sp-2);
}

.team-chat__report-actions .btn {
  flex: 1;
}

.team-chat__new-users {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2);
}

.team-chat__new-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--r-md);
  cursor: pointer;
}

.team-chat__new-user:hover {
  background: rgba(120, 120, 128, 0.08);
}

.team-chat__new-user input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.team-chat__new-user-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--r-full);
  background: linear-gradient(155deg, #ffb35c, #ff7a1a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
}

.team-chat__new-submit {
  margin: var(--sp-3) var(--sp-4) 0;
}

/* ":last-child" só apanha o botão "Criar Grupo" (é sempre o último no
   DOM) — quando só "Enviar Mensagem" está visível (1 pessoa escolhida),
   é o primeiro do DOM e ficava colado ao fundo do painel sem margem
   nenhuma. Por isso o seletor pelo próprio atributo, em vez de :last-child. */
.team-chat__new-submit:last-child,
[data-team-chat-new-submit-single] {
  margin-bottom: var(--sp-4);
}

.team-chat__new-submit + .team-chat__new-submit {
  margin-top: var(--sp-2);
}

/* Popup do nome do grupo — fica sobre o cartão do chat (não a página
   toda), por isso é absolute dentro de .team-chat__panel (que já é
   position:fixed) e não fixed: o objetivo é desfocar só o conteúdo do
   chat por trás, não a app inteira. */
.team-chat__group-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: rgba(10, 26, 51, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.team-chat__group-modal[hidden] {
  display: none;
}

.team-chat__group-modal-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--tc-glass-border);
  border-radius: 20px;
  box-shadow: var(--sh-lg);
}

.team-chat__group-modal-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--tc-ink);
}

.team-chat__group-modal-error {
  margin-top: calc(var(--sp-2) * -1);
  font-size: var(--fs-xs);
  color: var(--tc-danger);
}

.team-chat__group-modal-actions {
  display: flex;
  gap: var(--sp-2);
}

.team-chat__group-modal-actions .btn {
  flex: 1;
}

.team-chat__broadcast-hint {
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--tc-secondary);
}

.team-chat__broadcast-all {
  margin: 0 var(--sp-2);
  border-bottom: 1px solid var(--tc-hairline);
  border-radius: 0;
  padding-bottom: var(--sp-3);
}

.team-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.team-chat__msg {
  max-width: 78%;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.team-chat__msg:has(.team-chat__task-card) {
  max-width: 94%;
}

.team-chat__msg-body {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

.team-chat__msg--mine {
  align-self: flex-end;
  background: linear-gradient(155deg, rgba(10, 132, 255, 0.95), rgba(0, 90, 220, 0.95));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.team-chat__msg--theirs {
  align-self: flex-start;
  background: rgba(120, 120, 128, 0.08);
  color: var(--tc-ink);
  border-bottom-left-radius: 4px;
}

.team-chat__msg-sender {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--tc-accent);
  margin-bottom: 3px;
}

.team-chat__msg-time {
  display: block;
  font-size: 9.5px;
  margin-top: 4px;
  opacity: 0.7;
}

/* "Denunciar" — discreto, só nas mensagens dos outros. */
.team-chat__msg-report {
  display: block;
  margin-top: 2px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 10px;
  color: var(--tc-tertiary);
  text-decoration: underline;
  cursor: pointer;
}

.team-chat__msg-report:hover {
  color: var(--tc-secondary);
}

.team-chat__share-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  margin: var(--sp-2);
  background: var(--tc-accent-soft);
  border: 1px solid rgba(10, 132, 255, 0.3);
  border-radius: var(--r-md);
  font-size: var(--fs-xs);
  color: var(--tc-ink);
}

.team-chat__share-banner span {
  flex: 1;
}

.team-chat__attachment-preview {
  border-top: 1px solid var(--tc-hairline);
  padding: var(--sp-3);
}

.team-chat__attachment-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--tc-secondary);
  margin-bottom: var(--sp-2);
}

.team-chat__task-card {
  display: block;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--tc-hairline);
  border-radius: 14px;
  padding: var(--sp-3);
  text-decoration: none;
  color: var(--tc-ink);
}

.team-chat__msg .team-chat__task-card {
  margin-bottom: var(--sp-2);
}

/* Quem não tem permissão para abrir a tarefa partilhada (cargo sem
   acesso, ou Técnico de Manutenção com a tarefa já concluída) continua a
   ver o cartão na conversa — só não é clicável, por isso sem cursor de
   link e ligeiramente esbatido para não parecer interativo. */
.team-chat__task-card--locked {
  cursor: default;
  opacity: 0.7;
}

.team-chat__task-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 4px;
}

.team-chat__task-card-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--tc-ink);
}

.team-chat__task-card-code {
  font-size: 10.5px;
  color: var(--tc-tertiary);
  flex-shrink: 0;
}

.team-chat__task-card-desc {
  font-size: var(--fs-xs);
  color: var(--tc-secondary);
  margin: 0 0 var(--sp-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.team-chat__task-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10.5px;
}

.team-chat__task-card-date {
  color: var(--tc-tertiary);
}

.team-chat__task-card-price {
  font-weight: 700;
  color: var(--tc-ink);
}

.team-chat__task-card-sep {
  color: var(--tc-tertiary);
}

.team-chat__task-picker {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  flex-direction: column;
}

.team-chat__task-picker[hidden] {
  display: none;
}

.team-chat__task-picker-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-bottom: 1px solid var(--tc-hairline);
  flex-shrink: 0;
}

.team-chat__task-picker-search {
  flex: 1;
}

.team-chat__task-picker-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2);
}

.team-chat__task-picker-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
  border: 1px solid var(--tc-hairline);
  background: rgba(120, 120, 128, 0.05);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.team-chat__task-picker-item:last-child {
  margin-bottom: 0;
}

.team-chat__task-picker-item:hover {
  border-color: var(--tc-accent);
  background: var(--tc-accent-soft);
}

.team-chat__task-picker-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
}

.team-chat__task-picker-item-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--tc-ink);
}

.team-chat__task-picker-item-code {
  font-size: 10.5px;
  color: var(--tc-tertiary);
  flex-shrink: 0;
}

.team-chat__task-picker-item-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 10.5px;
  color: var(--tc-tertiary);
}

.team-chat__task-picker-item-date {
  margin-left: auto;
}

.team-chat__task-picker-toggle {
  flex-shrink: 0;
}

.team-chat__form {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-top: 1px solid var(--tc-hairline);
  flex-shrink: 0;
}

.team-chat__input {
  flex: 1;
  resize: none;
  max-height: 96px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--tc-hairline);
  border-radius: 18px;
  background: rgba(120, 120, 128, 0.08);
  color: var(--tc-ink);
  font-family: inherit;
  font-size: var(--fs-sm);
}
.team-chat__input:focus {
  outline: none;
  border-color: var(--tc-accent);
  box-shadow: 0 0 0 3px var(--tc-accent-soft);
}

.team-chat__send {
  background: linear-gradient(155deg, rgba(10, 132, 255, 0.95), rgba(0, 90, 220, 0.95));
  color: #fff;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .team-chat__panel {
    top: var(--sp-8);
    bottom: var(--sp-8);
    width: min(320px, calc(100vw - 32px));
  }
}

.ai-consent-gate__error {
  color: var(--state-late);
  font-size: var(--fs-sm);
  margin-top: var(--sp-3);
  text-align: right;
}

/* eNPS — check-in diário "Como te sentes hoje?" na entrada */
.enps-survey {
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  text-align: center;
}

.enps-survey__title {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--navy-900);
}

.enps-survey__hint {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.enps-survey__scale {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: var(--sp-4);
}

.enps-survey__dot {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  border: 2px solid var(--dot-color);
  color: var(--dot-color);
  background: var(--white);
  font-weight: 700;
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.enps-survey__dot:hover { transform: scale(1.08); }

.enps-survey__dot.is-selected {
  background: var(--dot-color);
  color: var(--white);
}

.enps-survey__note {
  width: 100%;
  min-height: 70px;
  margin-bottom: var(--sp-3);
}

.enps-survey__submit { width: 100%; margin-bottom: var(--sp-3); }

.enps-survey__thanks {
  margin: 0;
  font-weight: 700;
  color: var(--state-done);
}

/* iOS Safari faz zoom automático ao focar um campo de texto cujo
   font-size é menor que 16px — os tokens --fs-md/--fs-sm usados nos
   inputs (13px/12px) disparavam esse zoom em todos os formulários da
   app em mobile. Acima de 16px o Safari não faz zoom, por isso força-se
   esse mínimo só em ecrãs estreitos (o tamanho visual normal, mais
   pequeno, mantém-se em desktop). */
@media (max-width: 640px) {
  .input,
  .select,
  .textarea,
  .team-chat__input {
    font-size: 16px;
  }
}
