/* CITY | Jardim do Morro — estilo inspirado no Infante Residence */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f1f3f5;
  color: #1f2933;
  font-size: 14px;
}

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #e4e7eb;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.main {
  padding: 20px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===== Brand ===== */
.brand {
  padding: 6px 4px 18px;
  border-bottom: 1px solid #eef0f2;
  text-align: center;
}
/* Quando há logo, esconde os textos "CITY / Jardim do Morro" (o logo já os inclui) */
.brand:has(> .brand-logo:not([hidden])) .brand-title,
.brand:has(> .brand-logo:not([hidden])) .brand-sub {
  display: none;
}
.brand-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 2px;
  color: #1f2933;
}
.brand-sub {
  font-size: 12px;
  color: #6b7785;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ===== Panels ===== */
.panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.panel-title {
  font-size: 11px;
  font-weight: 600;
  color: #6b7785;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

/* ===== Level list ===== */
.levels-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.level-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: #f7f8fa;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.level-btn:hover {
  background: #eef1f4;
  border-color: #cfd5db;
}
.level-btn.active {
  background: #fff4d6;
  border-color: #f0c14b;
  box-shadow: 0 0 0 1px #f0c14b inset;
}
.level-btn .lvl-name {
  font-weight: 600;
  font-size: 13px;
  color: #1f2933;
}
.level-btn .lvl-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
}
.level-btn .lvl-pct {
  font-size: 10px;
  font-weight: 700;
  color: #117d4d;
  background: #d6f3e3;
  padding: 1px 6px;
  border-radius: 9px;
  letter-spacing: 0.2px;
}
.level-btn .lvl-blocks {
  font-size: 11px;
  color: #6b7785;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ===== Legend ===== */
.legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #4a5562;
}
.dot {
  width: 12px; height: 12px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.08);
}
.dot-livre     { background: #d9dde2; }
.dot-reservado { background: #f0a830; }
.dot-vendido   { background: #2bb673; }
.dot-parking   { background: #b9c4cf; }

.legend-p-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: #2a64a8;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 2px;
  line-height: 1;
  font-family: inherit;
  flex-shrink: 0;
}

/* ===== Buttons ===== */
.btn {
  border: 1px solid transparent;
  background: #1f2933;
  color: #fff;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #1f2933; }
.btn-secondary {
  background: #fff;
  color: #1f2933;
  border-color: #cfd5db;
}
.btn-secondary:hover { background: #f7f8fa; }
.btn-ghost {
  background: transparent;
  color: #6b7785;
  border-color: transparent;
}
.btn-ghost:hover { background: #f1f3f5; }

.icon-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  color: #6b7785;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  line-height: 1;
}
.icon-btn:hover { background: #f1f3f5; color: #1f2933; }

/* ===== Stats ===== */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.stat {
  background: #f7f8fa;
  border: 1px solid #eef0f2;
  border-radius: 7px;
  padding: 8px 10px;
}
.stat .v { font-weight: 700; font-size: 16px; color: #1f2933; }
.stat .l { font-size: 10px; color: #6b7785; text-transform: uppercase; letter-spacing: 0.4px; }

/* ===== Topbar ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4e7eb;
}
.level-title {
  font-size: 22px;
  font-weight: 700;
  color: #1f2933;
}
.level-sub {
  font-size: 13px;
  color: #6b7785;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  margin-top: 2px;
}
.pill {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.pill {
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.15s ease;
}
.pill-admin {
  background: #1f2933;
  color: #fff;
}
.pill-admin:hover { background: #2c3a47; }
.pill-broker {
  background: #f0c14b;
  color: #4a3500;
}
.pill-broker:hover { background: #e6b232; }
.pill-editor {
  background: #2a7fb7;
  color: #ffffff;
}
.pill-editor:hover { background: #1f6499; }

/* Editor mode: resize handles + add-fraction buttons */
.resize-handle {
  fill: #2a7fb7;
  stroke: #ffffff;
  stroke-width: 1;
  cursor: pointer;
}
.resize-handle.nw, .resize-handle.se { cursor: nwse-resize; }
.resize-handle.ne, .resize-handle.sw { cursor: nesw-resize; }
.apt-move-grip { fill: rgba(42, 127, 183, 0.0); cursor: move; }
body.mode-editor .apt-shape { stroke-dasharray: 4 2; }
body.mode-editor .apt { cursor: move; }
.add-frac-btn {
  cursor: pointer;
}
.add-frac-btn rect { fill: #2a7fb7; stroke: #ffffff; }
.add-frac-btn:hover rect { fill: #1f6499; }
.add-frac-btn text { fill: #ffffff; font-weight: 700; font-size: 14px; pointer-events: none; }
.btn-danger {
  background: #c0392b;
  color: #ffffff;
  border-color: transparent;
}
.btn-danger:hover { background: #a32f24; }
.btn-add-frac {
  background: #1f9b62;
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 12px;
}
.btn-add-frac:hover { background: #178755; }
body.mode-broker .btn-add-frac { display: none; }

/* Broker mode: hide admin-only UI */
body.mode-broker .panel-admin-tools,
body.mode-broker .modal-footer #btn-save,
body.mode-broker .status-toggle,
body.mode-broker #f-id {
  display: none;
}
/* Painel "Ferramentas" (Tabela de Preços) só visível em modo Broker */
body:not(.mode-broker) .panel-broker-tools { display: none; }
/* Broker: inputs/selects no modal principal aparecem como texto estático (sem borda, sem fundo).
   Excepção: o notify-modal (formulário de cliente/broker) tem regra própria mais à frente. */
body.mode-broker #modal .modal-body input,
body.mode-broker #modal .modal-body select {
  pointer-events: none;
  border: none;
  background: transparent;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1f2933;
  box-shadow: none;
}
body.mode-broker #modal .modal-body select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
}
body.mode-broker #modal .modal-body input:focus,
body.mode-broker #modal .modal-body select:focus {
  outline: none;
  box-shadow: none;
}
body.mode-broker #modal .modal-body input[type="checkbox"] {
  opacity: 0.5;
  pointer-events: none;
}
/* Em Broker: remover spinner arrows de inputs número (parecem editáveis) */
body.mode-broker #modal .modal-body input[type="number"] {
  -moz-appearance: textfield;
}
body.mode-broker #modal .modal-body input[type="number"]::-webkit-outer-spin-button,
body.mode-broker #modal .modal-body input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
body.mode-broker #btn-delete { display: none; }

/* ===== Modal de detalhe de notificações ===== */
.notif-detail-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notif-card {
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.notif-card-ok   { border-left: 4px solid #117d4d; }
.notif-card-warn { border-left: 4px solid #d97706; }
.notif-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.notif-card-type {
  font-weight: 700;
  font-size: 13px;
  color: #1f2933;
  letter-spacing: 0.4px;
}
.notif-card-date {
  font-size: 11px;
  color: #6b7785;
}
.notif-card-row {
  font-size: 12px;
  color: #4a5562;
  margin-top: 2px;
}
.notif-card-status { margin-top: 6px; }
.notif-status-ok   { color: #117d4d; font-weight: 600; }
.notif-status-warn { color: #d97706; font-weight: 600; }

/* ===== Ícone de notificação na fracção (só Admin vê) ===== */
.apt-notif-badge { cursor: pointer; }
.apt-notif-badge .notif-ok   { fill: #117d4d; stroke: #ffffff; stroke-width: 1; }
.apt-notif-badge .notif-warn { fill: #d97706; stroke: #ffffff; stroke-width: 1; }
.apt-notif-badge .notif-icon-text { fill: #ffffff; font-size: 11px; font-weight: 700; pointer-events: none; }
.apt-notif-badge .notif-count-bg { fill: #c0392b; stroke: #ffffff; stroke-width: 1; }
.apt-notif-badge .notif-count-text { fill: #ffffff; font-size: 8px; font-weight: 700; pointer-events: none; }
body.mode-broker .apt-notif-badge { display: none; }
/* Pill de troca Admin/Broker — só visível para utilizadores com role-admin.
   Brokers nunca veem o pill (não podem virar admin via clique). */
body.role-broker #btn-mode { display: none; }
body.mode-broker .apt-reservado .lprice,
body.mode-broker .apt-vendido .lprice { display: none; }
body.mode-broker .panel-errors,
body.mode-broker .panel-stats { display: none; }

/* ===== Dashboard ===== */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.block-card {
  background: #fff;
  border: 1px solid #e4e7eb;
  border-radius: 10px;
  padding: 14px 16px 16px;
  box-shadow: 0 1px 2px rgba(20,30,40,0.03);
}
.block-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.block-title {
  font-weight: 700;
  font-size: 14px;
  color: #1f2933;
  letter-spacing: 0.4px;
}
.block-meta {
  font-size: 11px;
  color: #6b7785;
}

.block-svg-wrap {
  width: 100%;
  overflow-x: auto;
}
.block-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ===== Apartment polygon styling ===== */
.block-svg { shape-rendering: geometricPrecision; }
.block-svg text { text-rendering: geometricPrecision; }
.apt {
  cursor: pointer;
  transition: filter 0.15s ease;
}
.apt:hover { filter: brightness(0.95); }
.apt-shape {
  stroke: #1f2933;
  stroke-width: 1.8;
}
.apt-livre     { fill: #e9edf1; }
.apt-reservado { fill: #fde2b8; }
.apt-vendido   { fill: #b8e6cc; }
.apt-parking   { fill: #f1f3f5; stroke: #b9c4cf; stroke-dasharray: 3 2; cursor: default; }

.apt-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: none;
  fill: #1f2933;
}
.apt-label .lid    { font-size: 12px; font-weight: 800; }
.apt-label .ltype  { font-size: 10px; font-weight: 700; fill: #4a5562; }
.apt-label .lfact  { font-size: 10px; fill: #6b7785; }
.apt-label .lprice { font-size: 12px; font-weight: 700; }
.apt-label .larea  { font-size: 11px; font-weight: 500; fill: #4a5562; }
.apt-label .lpark  { font-size: 9px; fill: #6b7785; }
.apt-label.lstatus            { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; }
.apt-label.lstatus-reservado  { fill: #b07418; }
.apt-label.lstatus-vendido    { fill: #117d4d; }

/* Parking icon (P inside a small square) */
.park-icon-bg { fill: #2a64a8; stroke: none; }
.park-icon-text { fill: #fff; font-size: 9px; font-weight: 700; }
.park-icon-sup { fill: #ffffff; font-size: 6px; font-weight: 700; pointer-events: none; }

/* Errors panel */
.panel-errors { background: #fff5e6; border: 1px solid #f0c14b; border-radius: 8px; padding: 10px 12px; }
.panel-title-warn { color: #8a5a00; }
.errors-count {
  display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px;
  background: #c98a25; color: #fff; border-radius: 999px; font-size: 10px; text-align: center;
}
.errors-list { display: flex; flex-direction: column; gap: 4px; }
.error-item { font-size: 11px; color: #6b4400; padding: 4px 6px; background: #fffaf0; border-radius: 4px; cursor: pointer; }
.error-item:hover { background: #ffe9bc; }

/* Divider between adjacent fractions (admin mode) */
.row-divider line { transition: stroke 0.12s ease, stroke-width 0.12s ease; }
.row-divider:hover line { stroke: #1f9b62; stroke-width: 2; }
.row-divider rect { transition: fill 0.12s ease; }
.row-divider:hover rect { fill: rgba(31, 155, 98, 0.08); }

.parking-label {
  fill: #6b7785;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-anchor: middle;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,30,40,0.45);
}
.modal-card {
  position: relative;
  width: min(540px, 92vw);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.modal-header {
  padding: 16px 20px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #eef0f2;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-sub { font-size: 12px; color: #6b7785; margin-top: 2px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-footer {
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #eef0f2;
  background: #fafbfc;
  align-items: center;
}

.status-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 16px;
}
.status-btn {
  background: #f7f8fa;
  border: 1px solid #cfd5db;
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #4a5562;
}
.status-btn[data-status="Livre"].on     { background: #e9edf1; border-color: #1f2933; color: #1f2933; }
.status-btn[data-status="Reservado"].on { background: #fde2b8; border-color: #c98a25; color: #7a4f0e; }
.status-btn[data-status="Vendido"].on   { background: #c8ecd8; border-color: #1f9b62; color: #0d5a36; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #4a5562; }
.field input, .field select {
  border: 1px solid #cfd5db;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 13px;
  background: #fff;
  color: #1f2933;
  font-family: inherit;
}
.field input:focus, .field select:focus {
  outline:ing: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #4a5562;
}
.status-btn[data-status="Livre"].on     { background: #e9edf1; border-color: #1f2933; color: #1f2933; }
.status-btn[data-status="Reservado"].on { background: #fde2b8; border-color: #c98a25;   font-size: 13px;
  background: #fff;
  color: #1f2933;
  font-family: inherit;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: #2a64a8;
  box-shadow: 0 0 0 2px rgba(42,100,168,0.15);
}
.field-wide { grid-column: 1 / -1; }
.btn-danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover { background: #a82c20; }

/* ===== Docs section in modal ===== */
.docs-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #eef0f2;
}
.docs-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #1f2933;
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}
.dropbox-row { display: flex; gap: 8px; align-items: stretch; }
.dropbox-row input { flex: 1; }
.dropbox-row .btn { white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.docs-checklist-wrap { margin-top: 12px; }
.docs-checklist-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  font-weight: 600;
  color: #4a5562;
  margin-bottom: 6px;
}
.docs-checklist-hint { font-size: 11px; color: #8a96a3; font-weight: 400; }
.docs-checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.doc-row {
  display: grid;
  grid-template-columns: 1fr 140px 24px;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  background: #fafbfc;
  border: 1px solid #eef0f2;
}
.doc-row.doc-expired { background: #fff5e6; border-color: #f0c14b; }
.doc-cb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #1f2933; cursor: pointer; }
.doc-cb input { transform: scale(1.05); cursor: pointer; }
.doc-row input[type="date"] {
  border: 1px solid #cfd5db; border-radius: 5px; padding: 4px 6px;
  font-size: 12px; background: #fff; color: #1f2933; font-family: inherit;
}
.doc-rm {
  background: transparent; border: none; color: #8a96a3;
  font-size: 16px; cursor: pointer; padding: 0; line-height: 1;
}
.doc-rm:hover { color: #c0392b; }
.docs-add-row { display: flex; gap: 6px; align-items: stretch; }
.docs-add-row input {
  flex: 1; border: 1px solid #cfd5db; border-radius: 6px;
  padding: 6px 9px; font-size: 12px; background: #fff;
  color: #1f2933; font-family: inherit;
}

/* Broker mode: secção Documentação com cabeçalho + campo "Link Dropbox" (label + botão Abrir).
   Sem checklist, sem input. */
body.mode-broker .docs-checklist-wrap { display: none; }
body.mode-broker .docs-dropbox input { display: none; }
body.mode-broker .docs-dropbox .dropbox-row {
  justify-content: flex-start;
}
body.mode-broker .docs-dropbox .dropbox-row .btn {
  pointer-events: auto;
}

/* ===== Definições panel (Admin only) ===== */
.panel-settings { /* mesmo padrão dos outros painéis */ }
body.mode-broker .panel-settings { display: none; }
.settings-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #4a5562; }
.settings-field input {
  border: 1px solid #cfd5db;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 12px;
  background: #fff;
  color: #1f2933;
  font-family: inherit;
}
.settings-field input:focus {
  outline: none;
  border-color: #2a64a8;
  box-shadow: 0 0 0 2px rgba(42,100,168,0.15);
}

/* ===== Botão Notificar (Broker only) ===== */
.btn-notify {
  background: #1f9b62;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-notify:hover { background: #178755; }
.btn-notify:disabled {
  background: #cfd5db;
  cursor: not-allowed;
}
/* Em admin mode, esconder sempre. Em broker, aparece se o botão tiver display:block via JS */
body:not(.mode-broker) #btn-notify { display: none !important; }

/* ===== Sub-modal de notificação ===== */
.modal-card-sm { max-width: 540px; }
.notify-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f2933;
  letter-spacing: 0.3px;
  margin: 6px 0 10px;
  padding-top: 6px;
  text-transform: uppercase;
}
.notify-section-title:not(:first-child) {
  margin-top: 14px;
  border-top: 1px solid #eef0f2;
  padding-top: 14px;
}
/* Anexos */
.attach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.attach-slot {
  border: 1px dashed #cfd5db;
  border-radius: 7px;
  padding: 10px 12px;
  background: #f9fafb;
}
.attach-label {
  font-size: 12px;
  font-weight: 600;
  color: #1f2933;
  margin-bottom: 6px;
}
.attach-slot input[type="file"] {
  width: 100%;
  font-size: 12px;
}
.attach-info {
  margin-top: 6px;
  font-size: 11px;
  color: #6b7785;
}
.attach-info-ok  { color: #117d4d; font-weight: 600; }
.attach-info-bad { color: #c0392b; font-weight: 600; }
/* Textarea de observações */
#n-observacoes {
  width: 100%;
  min-height: 80px;
  border: 1px solid #cfd5db;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.notify-warning {
  margin-top: 12px;
  padding: 8px 10px;
  background: #fff5e6;
  border: 1px solid #f0c14b;
  border-radius: 6px;
  font-size: 12px;
  color: #6b4400;
}

/* Notify modal inputs precisam ser editáveis mesmo em broker mode */
body.mode-broker #notify-modal .modal-body input {
  pointer-events: auto;
  background: #fff;
  color: #1f2933;
}

/* Loading overlay */
.loading-overlay {
  padding: 40px;
  text-align: center;
  color: #6b7785;
  font-size: 14px;
  background: #fff;
  border: 1px dashed #cfd5db;
  border-radius: 10px;
}
.loading-overlay.loading-error {
  color: #c0392b;
  background: #fff5f4;
  border-color: #f0a999;
}

/* Select para "+ Fração" no Bloco A */
.add-frac-select {
  background: #1f9b62;
  color: #ffffff;
  border: none;
  padding: 4px 26px 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 12px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path fill='%23ffffff' d='M1 3l4 4 4-4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  font-family: inherit;
}
.add-frac-select:hover { background-color: #178755; }
.add-frac-select option {
  background: #ffffff;
  color: #1f2933;
}

/* ===== Login page ===== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f1f3f5;
}
.login-card {
  background: #fff;
  padding: 36px 32px;
  border-radius: 12px;
  border: 1px solid #e4e7eb;
  box-shadow: 0 4px 24px rgba(20, 30, 40, 0.06);
  width: 100%;
  max-width: 380px;
}
.login-brand {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eef0f2;
}
.login-brand-title {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 3px;
  color: #1f2933;
}
.login-brand-sub {
  font-size: 13px;
  color: #6b7785;
  letter-spacing: 1px;
  margin-top: 4px;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form[hidden], .login-pending[hidden] { display: none !important; }
.login-form .field input {
  padding: 10px 12px;
  font-size: 14px;
}
.login-submit {
  margin-top: 6px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}
.login-error {
  background: #fff1f0;
  border: 1px solid #f5c2c0;
  color: #a32f24;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
}

/* ===== Topbar: user info + logout ===== */
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b7785;
}
.user-email {
  font-weight: 500;
  color: #4a5562;
}
.btn-logout {
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid #cfd5db;
}

/* ===== Email lists em Definições ===== */
.email-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.email-list-title {
  font-size: 11px;
  font-weight: 600;
  color: #6b7785;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.email-list-wrap[hidden] { display: none !important; }
.email-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}
.email-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f7f8fa;
  border: 1px solid #eef0f2;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}
.email-row-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f2933;
}
.email-row-rm {
  background: transparent;
  border: none;
  color: #b0b7bf;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.email-row-rm:hover {
  color: #c0392b;
  background: #fdecea;
}
.email-row-empty {
  font-size: 12px;
  color: #9aa3ad;
  font-style: italic;
  padding: 4px 2px;
}
.email-list-add {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  align-items: center;
}
.email-list-add input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid #cfd5db;
  border-radius: 6px;
  background: #fff;
  color: #1f2933;
}
.email-list-add .btn {
  padding: 6px 10px;
  font-size: 12px;
}

/* ============================================================
 * Responsive — mobile / narrow viewports
 * ============================================================ */

/* Hamburger button + backdrop: por defeito escondidos em desktop */
.btn-sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid #cfd5db;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  color: #1f2933;
  margin-right: 8px;
}
.btn-sidebar-toggle:hover { background: #f1f3f5; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}

@media (max-width: 900px) {
  /* Grid passa a uma coluna; sidebar é overlay */
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85%;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
  .btn-sidebar-toggle {
    display: inline-block;
  }

  /* Topbar mais compacto */
  .topbar {
    padding-bottom: 8px;
  }
  .level-title { font-size: 18px; }
  .level-sub { font-size: 11px; }
  .user-info .user-email { display: none; }

  .main {
    padding: 12px 14px 32px;
  }

  .block-svg-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .block-svg {
    min-width: 600px;
  }

  .modal-card,
  .modal-card-sm {
    width: 96%;
    max-width: 96%;
    margin: 10px auto;
    max-height: 92vh;
    overflow-y: auto;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .brand-title { font-size: 16px; }
  .topbar-right .pill { font-size: 10px; padding: 3px 8px; }
  .btn-logout { padding: 4px 8px; font-size: 11px; }
  .stat .v { font-size: 14px; }
}

/* ===== Email account panel (broker mode) ===== */
.email-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e4e7eb;
  background: #f7f8fa;
}
.email-status-disconnected { border-color: #cfd5db; }
.email-status-connected    { border-color: #117d4d; background: #ecf9f1; }
.email-status-text {
  font-size: 12px;
  font-weight: 600;
  color: #4a5562;
}
.email-status-connected .email-status-text { color: #117d4d; }
.email-status .btn { padding: 6px 10px; font-size: 12px; }

.email-help {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #f7f8fa;
  border: 1px solid #eef0f2;
  font-size: 12px;
  color: #4a5562;
}
.email-help p { margin: 0 0 6px 0; }
.email-help ol { margin: 0; padding-left: 20px; }
.email-help li { margin-bottom: 3px; }

.email-detected {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #ecf9f1;
  border: 1px solid #117d4d;
  font-size: 12px;
  color: #117d4d;
  font-weight: 600;
}
.email-detected.email-detected-unknown {
  background: #fff5e6;
  border-color: #f0c14b;
  color: #b35d00;
}

/* ===== Signup / Pending login states ===== */
.login-switch {
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: #6b7785;
}
.login-switch a {
  color: #1f9b62;
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}
.login-switch a:hover { text-decoration: underline; }

.login-pending {
  text-align: center;
  padding: 4px;
}
.login-pending h2 {
  font-size: 18px;
  margin: 0 0 12px 0;
  color: #117d4d;
}
.login-pending p {
  font-size: 13px;
  color: #4a5562;
  line-height: 1.5;
  margin: 8px 0;
}
.login-pending strong { color: #1f2933; }
.login-pending .login-submit { margin-top: 14px; display: inline-block; text-decoration: none; }


/* ===== Painel Contas Pendentes (admin) ===== */
.panel-pending-accounts { /* visível só para admin via JS */ }
body.mode-broker .panel-pending-accounts { display: none; }

/* Estado normal: sem pedidos pendentes */
.panel-pending-accounts .panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Estado destacado: HÁ pedidos pendentes */
.panel-pending-accounts.has-pending {
  background: #fff4e5;
  border: 1.5px solid #d97706;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  animation: pending-pulse 2.4s ease-in-out infinite;
}
.panel-pending-accounts.has-pending .panel-title {
  color: #b45309;
  font-weight: 700;
}
.panel-pending-accounts.has-pending .btn {
  background: #d97706;
  color: #fff;
  border-color: #d97706;
}
.panel-pending-accounts.has-pending .btn:hover {
  background: #b45309;
  border-color: #b45309;
}

@keyframes pending-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.0); }
  50%      { box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.18); }
}

/* Badge com o número */
.pending-count-badge[hidden] { display: none !important; }
.pending-count-badge {
  display: inline-block;
  min-width: 22px;
  height: 22px;
  line-height: 22px;
  padding: 0 7px;
  text-align: center;
  border-radius: 11px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}

/* Cards dentro do modal de pedidos */
.pending-card {
  border: 1px solid #e3e7ec;
  border-left: 4px solid #d97706;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fff;
}
.pending-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.pending-card-actions .btn-approve {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.pending-card-actions .btn-reject {
  background: #fff;
  color: #dc2626;
  border-color: #dc2626;
}

/* ===== O meu histórico (broker) ===== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}
.history-empty {
  text-align: center;
  color: #6b7785;
  padding: 30px 20px;
  font-size: 14px;
}
.history-card {
  border: 1px solid #e3e7ec;
  border-left: 4px solid #2a64a8;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  font-size: 13px;
}
.history-card .history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.history-frac {
  font-weight: 700;
  color: #1f2933;
  font-size: 14px;
}
.history-date {
  font-size: 11px;
  color: #6b7785;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.history-to {
  color: #4a5562;
  font-size: 12px;
}
.history-client {
  font-size: 12px;
  color: #4a5562;
  margin-bottom: 2px;
}
.history-subject {
  margin-top: 6px;
  font-weight: 600;
  color: #1f2933;
  font-size: 13px;
}
.history-obs {
  margin-top: 6px;
  padding: 6px 8px;
  background: #f7f8fa;
  border-radius: 4px;
  font-size: 12px;
  color: #4a5562;
  white-space: pre-wrap;
  line-height: 1.4;
}
.history-foot {
  margin-top: 8px;
  font-size: 11px;
  color: #6b7785;
}
.history-attach {
  display: inline-block;
  padding: 2px 8px;
  background: #eef1f4;
  border-radius: 10px;
  font-weight: 600;
}
.history-err {
  margin-top: 6px;
  padding: 6px 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  font-size: 12px;
  color: #b91c1c;
}
.history-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.history-badge-sent {
  background: #d6f3e3;
  color: #117d4d;
}
.history-badge-failed {
  background: #fee2e2;
  color: #b91c1c;
}

/* Histórico só visível em modo Broker */
body:not(.mode-broker) #btn-my-history { display: none; }

/* ===== Notificação no botão do bloco (sidebar) ===== */
.lvl-name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lvl-notif {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px 1px 5px;
  background: #fff4d6;
  color: #b45309;
  border: 1px solid #f0c14b;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.lvl-notif-icon {
  flex-shrink: 0;
}
.lvl-notif-count {
  font-variant-numeric: tabular-nums;
}


/* ===== Modal Gerir Acessos ===== */
.access-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 50vh;
  overflow-y: auto;
}
.access-empty {
  text-align: center;
  color: #6b7785;
  padding: 20px;
  font-size: 13px;
}
.access-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #e3e7ec;
  border-radius: 6px;
  background: #fff;
}
.access-email {
  flex: 1;
  font-size: 13px;
  color: #1f2933;
  word-break: break-all;
}
.access-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.access-badge-admin {
  background: #1f2933;
  color: #fff;
}
.access-badge-broker {
  background: #f0c14b;
  color: #4a3500;
}
.access-remove {
  padding: 4px 10px;
  font-size: 12px;
  flex-shrink: 0;
}
.access-add {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e3e7ec;
}
.access-add-title {
  font-size: 11px;
  font-weight: 600;
  color: #6b7785;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.access-add-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.access-add-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #cfd5db;
  border-radius: 6px;
  font-size: 13px;
}
.access-add-row select {
  padding: 8px 10px;
  border: 1px solid #cfd5db;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}

/* ===== Esconder badge de notificações por bloco em modo Broker ===== */
body.mode-broker .lvl-notif { display: none !important; }

/* ===== Histórico do Broker — reorganização ===== */
.history-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.history-when {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.history-time {
  font-size: 14px;
  font-weight: 700;
  color: #1f2933;
  font-variant-numeric: tabular-nums;
}
.history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  background: #f7f8fa;
  border-radius: 6px;
  padding: 8px 10px;
}
.history-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.history-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7785;
  font-weight: 600;
}
.history-value {
  font-size: 13px;
  color: #1f2933;
  font-weight: 600;
  word-break: break-word;
}
.history-value.history-frac {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.history-value.history-price {
  color: #117d4d;
  font-variant-numeric: tabular-nums;
}

/* ===== Logo do projecto ===== */
.brand-logo {
  display: block;
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
  margin: 0 auto;
  padding: 4px 0;
}
.brand-logo[hidden] { display: none !important; }

.logo-upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.logo-preview {
  width: 100%;
  min-height: 60px;
  border: 1px dashed #cfd5db;
  border-radius: 6px;
  padding: 8px;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-preview img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}
.logo-empty {
  font-size: 11px;
  color: #6b7785;
  font-style: italic;
}
.logo-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.logo-upload-btn {
  display: inline-block;
  cursor: pointer;
  font-size: 12px;
}

/* ===== Modal Configurar Reservas (admin) ===== */
.rsv-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f2;
}
.rsv-section:last-child { border-bottom: none; }
.rsv-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #6b7785;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}
.rsv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.rsv-grid input[type="number"] {
  padding: 8px 10px;
  border: 1px solid #cfd5db;
  border-radius: 6px;
  font-size: 13px;
}
.rsv-businesshours {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rsv-day-row {
  display: grid;
  grid-template-columns: 160px 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #f7f8fa;
  border-radius: 6px;
}
.rsv-day-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1f2933;
  font-weight: 600;
}
.rsv-day-row input[type="time"] {
  padding: 6px 8px;
  border: 1px solid #cfd5db;
  border-radius: 5px;
  font-size: 13px;
  width: 100%;
}
.rsv-day-sep {
  font-size: 11px;
  color: #6b7785;
}
.rsv-holidays-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 28px;
}
.rsv-holiday-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef1f4;
  border: 1px solid #cfd5db;
  border-radius: 12px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
  color: #1f2933;
  font-variant-numeric: tabular-nums;
}
.rsv-holiday-remove {
  background: transparent;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.rsv-holiday-remove:hover { color: #a32f24; }
.rsv-holiday-empty {
  font-size: 12px;
  color: #6b7785;
  font-style: italic;
}
.rsv-holiday-add {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rsv-holiday-add input[type="date"] {
  padding: 6px 8px;
  border: 1px solid #cfd5db;
  border-radius: 6px;
  font-size: 13px;
}
.rsv-save-status {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.rsv-save-ok {
  background: #d6f3e3;
  color: #117d4d;
  border: 1px solid #117d4d;
}
.rsv-save-err {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #b91c1c;
}

/* ===== Modal Confirmar Reserva sem documentação ===== */
.notify-footer-two-actions {
  flex-wrap: wrap;
  gap: 8px;
}
.rsv-confirm-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #1f2933;
}
.rsv-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #eef0f2;
}
.rsv-confirm-label {
  color: #6b7785;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.rsv-confirm-value {
  font-weight: 600;
  text-align: right;
}
.rsv-confirm-value.rsv-confirm-deadline {
  color: #b45309;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.rsv-confirm-note {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff4e5;
  border: 1px solid #f0c14b;
  border-radius: 6px;
  font-size: 12px;
  color: #4a5562;
  line-height: 1.5;
}
.rsv-confirm-note strong { color: #b45309; }

/* ===== Acções Pendentes (Broker) ===== */
.btn-warning-pulse {
  background: #d97706;
  color: #fff;
  border: 1px solid #d97706;
  animation: pa-pulse 2.4s ease-in-out infinite;
}
.btn-warning-pulse:hover { background: #b45309; border-color: #b45309; }
@keyframes pa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(217, 119, 6, 0.25); }
}

.pa-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}
.pa-card {
  border: 1px solid #e3e7ec;
  border-left: 4px solid #d97706;
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
}
.pa-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.pa-frac {
  font-weight: 700;
  font-size: 16px;
  color: #1f2933;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.pa-countdown {
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  background: #fff4e5;
  border: 1px solid #f0c14b;
  padding: 3px 10px;
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
}
.pa-countdown-expired {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.pa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  background: #f7f8fa;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.pa-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pa-cell-wide {
  grid-column: 1 / -1;
}
.pa-label {
  font-size: 10px;
  color: #6b7785;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pa-value {
  font-size: 13px;
  font-weight: 600;
  color: #1f2933;
}
.pa-value.pa-price {
  color: #117d4d;
  font-variant-numeric: tabular-nums;
}
.pa-value.pa-deadline {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #b45309;
}
.pa-actions {
  display: flex;
  justify-content: flex-end;
}
.pa-submit-btn { font-size: 13px; }

/* ===== Modal Completar Reserva ===== */
.cr-summary {
  background: #f7f8fa;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cr-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #4a5562;
}
.cr-summary-row strong { color: #1f2933; }
.cr-summary-row strong.cr-deadline {
  color: #b45309;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.cr-attachments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.cr-attach-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
}
.cr-attach-label {
  font-size: 12px;
  font-weight: 600;
  color: #4a5562;
  grid-column: 1 / -1;
}
.cr-attach-btn { font-size: 12px; }
.cr-attach-info {
  grid-column: 1 / -1;
  font-size: 11px;
  color: #6b7785;
  margin-top: -2px;
}

/* ===== Painel "Acção Pendente" no modal da fracção ===== */
.fraction-pending-panel {
  background: #fff4e5;
  border: 1.5px solid #d97706;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  animation: pa-pulse 2.4s ease-in-out infinite;
}
.fpp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.fpp-title {
  font-weight: 700;
  font-size: 13px;
  color: #b45309;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fpp-countdown {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #d97706;
  padding: 3px 9px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.fpp-body {
  font-size: 13px;
  color: #4a5562;
  line-height: 1.5;
  margin-bottom: 10px;
}
.fpp-body strong { color: #b45309; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.fpp-actions {
  display: flex;
  justify-content: flex-end;
}

/* ===== Indicação visual na fracção (SVG) — pequeno triangulo laranja ===== */
.apt-pending-flag {
  pointer-events: none;
}

/* ===== Ícone "!" Acção Pendente no SVG da fracção (broker dono) ===== */
.apt-pending-badge { cursor: help; }
.apt-pending-badge .pending-icon-bg {
  fill: #d97706;
  stroke: #b45309;
  stroke-width: 0.5;
}
.apt-pending-badge .pending-icon-text {
  fill: #ffffff;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  pointer-events: none;
}

/* ===== Histórico — badges adicionais ===== */
.history-badge-pending {
  background: #fff4e5;
  color: #b45309;
  border: 1px solid #f0c14b;
}
.history-badge-expired {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ===== Modal Sucesso de Reserva ===== */
.rsv-success-icon {
  text-align: center;
  font-size: 48px;
  color: #16a34a;
  background: #d6f3e3;
  width: 72px;
  height: 72px;
  line-height: 72px;
  border-radius: 50%;
  margin: 0 auto 16px;
  font-weight: 700;
}
.rsv-success-content {
  font-size: 13px;
  color: #1f2933;
  line-height: 1.5;
}
.rsv-success-row {
  padding: 4px 0;
}
.rsv-success-deadline {
  font-size: 16px;
  font-weight: 700;
  color: #b45309;
  text-align: center;
  padding: 8px 12px;
  background: #fff4e5;
  border: 1px solid #f0c14b;
  border-radius: 6px;
  margin: 10px 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.rsv-success-warning {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 12px;
  color: #4a5562;
  line-height: 1.5;
}
.rsv-success-warning strong { color: #b91c1c; }
.rsv-success-row-info {
  background: #eef1f4;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #4a5562;
  margin-top: 10px;
}
.rsv-success-row-warn {
  background: #fff4e5;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #b45309;
  margin-top: 10px;
}

/* ===== Modal Detalhe do Broker (admin) ===== */
.bd-block-warning {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}
.bd-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.bd-stat {
  background: #f7f8fa;
  border: 1px solid #eef0f2;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
}
.bd-stat-v { font-size: 20px; font-weight: 700; color: #1f2933; }
.bd-stat-l { font-size: 10px; color: #6b7785; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }
.bd-section {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef0f2;
}
.bd-section:last-child { border-bottom: none; }
.bd-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #6b7785;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.bd-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bd-empty {
  font-size: 12px;
  color: #6b7785;
  font-style: italic;
  padding: 6px 4px;
}
.bd-item {
  border: 1px solid #e3e7ec;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  font-size: 12px;
}
.bd-item-cooldown {
  border-left: 3px solid #d97706;
}
.bd-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
}
.bd-item-client {
  color: #6b7785;
  font-size: 12px;
}
.bd-item-label {
  color: #6b7785;
  font-size: 11px;
}
.bd-item-val {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #1f2933;
}
.bd-override-btn {
  font-size: 11px;
  padding: 4px 8px;
}

/* Badge "Aguarda validação" no Detalhe do Broker */
.bd-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 6px;
}
.bd-badge-await {
  background: #fff4e5;
  color: #b45309;
  border: 1px solid #f0c14b;
}
.bd-validate-btn { font-size: 11px; padding: 4px 8px; }
.bd-reject-btn { font-size: 11px; padding: 4px 8px; margin-left: 6px; }

/* ===== Modal Ponto de Situação (broker) ===== */
.ss-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}
.ss-card {
  border: 1px solid #e3e7ec;
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
}
.ss-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.ss-frac {
  font-weight: 700;
  font-size: 16px;
  color: #1f2933;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.ss-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ss-badge-warn { background: #fff4e5; color: #b45309; border: 1px solid #f0c14b; }
.ss-badge-info { background: #eef1f4; color: #4a5562; border: 1px solid #cfd5db; }
.ss-badge-ok   { background: #d6f3e3; color: #117d4d; border: 1px solid #117d4d; }
.ss-badge-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.ss-client {
  font-size: 13px;
  color: #4a5562;
  margin-bottom: 6px;
}
.ss-deadline {
  font-size: 12px;
  color: #4a5562;
  padding: 6px 8px;
  background: #f7f8fa;
  border-radius: 4px;
  margin-top: 4px;
}
.ss-deadline strong { color: #b45309; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.ss-await { background: #fff4e5; color: #b45309; }
.ss-await-warn { background: #fef2f2; color: #b91c1c; }
.ss-warn { background: #fef2f2; color: #b91c1c; }

/* ===== Modal de confirmacao generico ===== */
.ff-confirm-message {
  font-size: 14px;
  color: #1f2933;
  line-height: 1.5;
  padding: 4px 0;
  white-space: normal;
}
.ff-confirm-message br { display: block; content: ""; margin-bottom: 4px; }
.btn-confirm-approve { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn-confirm-approve:hover { background: #15803d; border-color: #15803d; }

/* Admin reservation panel: info grid */
.fpp-info-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fpp-info-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.fpp-info-row:last-child { border-bottom: none; }
.fpp-info-label {
  font-weight: 600;
  color: #6b7785;
  min-width: 80px;
  text-transform: none;
  font-size: 12px;
  letter-spacing: 0.2px;
}
.fpp-info-value {
  color: #1f2933;
  flex: 1;
  word-break: break-word;
}

/* ===== Stats bar (Resumo) ===== */
.stats { grid-column: 1 / -1; }
.stats > * { grid-column: span 1; }
.stats-bar-wrap {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: 8px 10px;
  background: #f7f8fa;
  border: 1px solid #eef0f2;
  border-radius: 7px;
}
.stats-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #6b7785;
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.stats-bar-pct {
  color: #117d4d;
  background: #d6f3e3;
  padding: 1px 8px;
  border-radius: 9px;
  font-size: 10px;
  letter-spacing: 0.2px;
}
.stats-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #eef0f2;
}
.stats-bar-thin { height: 8px; border-radius: 4px; }
.stats-bar-seg {
  height: 100%;
  transition: width 0.3s ease;
}
.stats-bar-vendido { background: #2bb673; }
.stats-bar-reservado { background: #f0a830; }
.stats-bar-livre { background: #d9dde2; }

.stats-typologies {
  grid-column: 1 / -1;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stats-typologies-title {
  font-size: 11px;
  font-weight: 600;
  color: #6b7785;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 4px;
}
.stats-typ-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stats-typ-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
}
.stats-typ-name { font-weight: 600; color: #1f2933; }
.stats-typ-nums { color: #6b7785; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 10px; }
.stat-volume { grid-column: 1 / -1; }

/* ===== Gerir Acessos: secções admin/broker ===== */
.access-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f2933;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 4px 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.access-section-title:first-child { margin-top: 0; }
.access-section-count {
  background: #eef0f2;
  color: #4a5562;
  padding: 1px 8px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
}
.access-section-note {
  font-size: 11px;
  color: #6b7785;
  margin-bottom: 8px;
  line-height: 1.4;
}
.access-section-sep {
  height: 1px;
  background: #eef0f2;
  margin: 16px 0 8px;
}

/* Gerir Acessos: form add email notificação */
.access-notif-add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.access-notif-add input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #cfd5db;
  border-radius: 6px;
  background: #fff;
  color: #1f2933;
}
.access-notif-add .btn { padding: 8px 12px; font-size: 13px; }
