/* ======================================================================
   tarefas.css  –  versão COMPLETA (sem omissões)
   A folha oficial com:
     • banner do nome da obra
     • seletor de obra no cabeçalho
     • correção para pré-visualização de fotos (img.preview-img ou div.preview-img)
     • quick panel de pessoas
     • modal de organização (listas/cartões) com DnD e ações em lote
     • botões de ordenação por lista (Nome/Peso)
     • destaque do "Peso" na lista diária do calendário
     • chips de prioridade bonitos por nível
     • telas novas: Vincular Serviços e Resumo (tabelas)
====================================================================== */

/* ------------------------------
   RESET BÁSICO
--------------------------------*/
* { box-sizing: border-box; }
body { margin: 0; font-family: sans-serif; background: #f0f2f5; }
h1,h2,h3,h4,h5,h6 { margin: 0; }

/* ------------------------------
   CABEÇALHO / BOTÕES
--------------------------------*/
header {
  background: #004a7c;
  color: #fff;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative; /* para ancorar o quick panel */
}

/* seletor de obra (dropdown) */
#obraSelect {
  background: #fff;
  color: #004a7c;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  padding: 0.3rem 0.4rem;
  cursor: pointer;
}

/* NOVO: interatividade nos quadradinhos da Vertical */
.vblock { cursor: pointer; transition: transform .06s ease; }
.vblock:active { transform: scale(.94); }

/* ===== NOVO: Estilos para META (peso e empreiteiro) ===== */
.meta-weight {
  font-size: 0.85em;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}

.meta-contractor {
  font-size: 0.7em;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* =======================
   BOTÕES & TOOLBAR PRO
   ======================= */
.btn{
  border:1px solid #dbe4ff;
  background:#eef2ff;
  border-radius:10px;
  padding:.48rem .8rem;
  font-weight:700;
  cursor:pointer;
  box-shadow: 0 2px 6px rgba(79,70,229,.08), inset 0 0 0 1px rgba(255,255,255,.45);
}
.btn:hover{ filter:brightness(1.04); }
.btn:active{ transform: translateY(1px); }
.btn-lg{ padding:.6rem 1rem; }
.btn-ghost{
  background:#fff; border-color:#e5e7eb;
}
.btn[aria-pressed="true"]{
  background:#dbe4ff; border-color:#b6c3ff;
}
.segmented{
  display:inline-flex; gap:.25rem; padding:.2rem; background:#fff;
  border:1px solid #e5e7eb; border-radius:12px;
}
.toolbar-row{
  display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; margin:.25rem 0;
}
.toolbar-row.right{ 
  margin-left:auto; 
  display:flex;
  align-items:center;
  gap:.6rem;
}
.toolbar-field{ 
  display:flex; 
  align-items:center; 
  gap:.35rem;
  height: 40px; /* Altura uniforme para todos os campos */
}
.toolbar-label{ 
  font-weight:700; 
  color:#0f172a;
  display:flex;
  align-items:center;
  height: 100%;
}
.ctl{
  border:1px solid #e5e7eb; 
  background:#fff; 
  border-radius:10px; 
  padding:.35rem .5rem;
  height: 40px; 
  min-width: 160px;
  display:flex;
  align-items:center;
}
.stair-toolbar{ 
  align-items:center; 
  justify-content:space-between;
  gap: 1rem; /* Espaçamento entre as linhas */
}

/* Grupo dos presets da Escadinha + chip de filtros avançados */
.stair-toolbar .toolbar-group{
  display:flex;
  flex-wrap:wrap;
  gap:.45rem;
  align-items:center;
  height: 40px; /* Altura uniforme */
}
.stair-toolbar .toolbar-group.presets-group{
  margin-left:auto;
  display:flex;
  align-items:center;
}
.stair-toolbar .toolbar-group.presets-group .toolbar-label{
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:.03em;
  color:#6b7280;
  display:flex;
  align-items:center;
  height: 100%;
}
.stair-toolbar .presets-chips{
  display:inline-flex;
  flex-wrap:wrap;
  gap:.25rem;
  align-items:center;
}
.stair-toolbar .stair-adv-filters-btn{
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  font-weight:700;
}

/* Ajustes para botões da toolbar */
.stair-toolbar .btn {
  height: 40px;
  min-height: 40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: .35rem .6rem;
}

/* Ajustes para selects na toolbar */
.stair-toolbar select {
  height: 40px;
  min-height: 40px;
  display:inline-flex;
  align-items:center;
}

/* Garantir alinhamento vertical dos labels com emojis */
.stair-toolbar label[style*="font-size:1.5em"],
.stair-toolbar label[style*="font-size:1.8em"] {
  display:flex;
  align-items:center;
  justify-content:center;
  height: 40px;
  line-height: 1;
}

/* Status de medição alinhado */
.stair-toolbar #stairMeasureStatus {
  display:inline-flex;
  align-items:center;
  height: 40px;
}


/* ===== SELEÇÃO MÚLTIPLA NA VERTICAL ===== */
.vblock.v-selected {
  outline: 3px solid #2563eb;
  outline-offset: -1px;
  box-shadow: 0 0 0 1px white, 0 0 8px rgba(37, 99, 235, 0.5) !important;
  z-index: 10;
  position: relative;
}

/* ===== CORREÇÃO: Submenu de filtros sempre visível ===== */
#filtersSubmenu {
  position: fixed !important;
  z-index: 10000 !important;
}

/* ===== Bloqueio de cliques na Vertical ===== */
/* Quando o modal estiver em modo bloqueado, desliga cliques e muda o visual */
#stairModal.vertical-locked .vblock {
  pointer-events: none;
  cursor: not-allowed;
  opacity: .6;
  transform: none;
}
/* Estado do botão "Lançar Medição" ao desbloquear */
#stairMeasure.is-unlocked {
  font-weight: 800;
  outline: 2px solid #2563eb;
  border-radius: 9999px;
}


/* NOVO: tabela do Resumo de Obras */
.works-table { width:100%; border-collapse: collapse; }
.works-table th, .works-table td { border:1px solid #e5e7eb; padding:.5rem .6rem; background:#fff; }

/* --------------------------------
   MODAIS – TELA CHEIA UNIVERSAL
   (CSS-only, sem Fullscreen API)
-----------------------------------*/
/* --vh já é declarado no <head> (manter apenas lá para evitar duplicidade) */
/* :root { --vh: 1vh; } */

/* Mantido — comportamentos detalhados já estão no <head>. Essas regras aqui podem ficar,
   mas se preferir “fonte única de verdade”, pode removê-las do .css. */

/* ===== NOVO: em “Só vertical”, compat: também aceite .only-vertical ===== */
#stairModal.stair-only-vertical .stair-scroll:not(#stairVertical),
#stairModal.only-vertical .stair-scroll:not(#stairVertical){
  display: none !important;
}
#stairModal.stair-only-vertical #stairVertical,
#stairModal.only-vertical #stairVertical{
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* Compat fullscreen: responda tanto a .stair-full quanto a .is-fullscreen (JS antigo) */
#stairModal.is-fullscreen .modal-content,
#stairModal.is-fullscreen .modal-content.large{
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: calc(var(--vh, 1vh) * 100) !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 12px 12px 16px;
}
#stairModal.is-fullscreen .stair-scroll{
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Importação – barra e mensagem com mais contraste ===== */
#importProgress .bar-wrap{ height:10px; border:1px solid #dbe4ff; border-radius:999px; background:#f8fafc }
#importProgress .bar{ height:100%; border-radius:999px; background:linear-gradient(90deg,#93c5fd,#6366f1) }
#importProgress .msg{ font-size:.9rem; color:#334155; margin-top:.35rem }

.header-btns {
  margin-left: auto;                /* empurra para a direita */
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.header-btns button {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: #fff;
  cursor: pointer;
}

/* ------------------------------
   BANNER COM NOME DA OBRA
--------------------------------*/
.board-header {
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  background: #d9edf7;
  color: #004a7c;
  padding: 0.5rem;
  border-bottom: 1px solid #bcdff1;
  user-select: none;
}

/* ------------------------------
   ÁREA PRINCIPAL
--------------------------------*/
main          { padding: 0; overflow-x: auto; }
#board        { display: flex; gap: 1rem; padding: 1rem; }
#board .list  { flex-shrink: 0; }   /* evita encolher as colunas */

/* ------------------------------
   LISTAS (colunas)
--------------------------------*/
.list {
  background: #e2e4e6;
  border-radius: 4px;
  width: 272px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.list-header h2 { font-size: 1rem; margin-right:.25rem; display:flex; align-items:center; gap:.35rem; }
.remove-list    { cursor: pointer; font-weight: bold; }

/* Controles de ordenação no cabeçalho da lista */
.sort-group {
  display:flex; gap:.25rem; align-items:center;
}
.sort-btn {
  background: rgba(255,255,255,.2);
  color:#fff;
  border:1px solid rgba(255,255,255,.4);
  border-radius: 4px;
  font-size:.78rem;
  padding:.12rem .35rem;
  cursor:pointer;
}
.sort-btn.active {
  background: #fff;
  color:#004a7c;
  border:2px solid #fff; /* destaque quando ativo */
  font-weight:700;
}

/* ------------------------------
   CARD-LIST (container interno)
--------------------------------*/
.card-list {
  flex: 1;
  overflow-y: auto;
  min-height: 50px;
}
.card-list.drag-over { background: rgba(0,0,0,0.05); }

/* ------------------------------
   CARTÕES
--------------------------------*/
.card {
  background: #fff;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 3px;
  border: 1px solid #ccc;
  cursor: grab;
  transition: background 0.2s;
}
.card:hover    { background: #f9f9f9; }
.card.dragging { opacity: 0.5; }

/* placeholder durante drag */
.card.placeholder {
  border: 2px dashed #aaa;
  background: rgba(0,0,0,0.07);
  min-height: 60px;
}

/* conteúdo do cartão */
.card-title   { font-weight: bold; }
.card-percent { font-size: 0.8rem; color: #555; margin-top: 0.2rem; }
.card-dates   { font-size: 0.75rem; color: #777; margin-top: 0.2rem; }
.card-icons   { margin-top: 0.35rem; font-size: 0.9rem; display:flex; flex-wrap:wrap; gap:.25rem .35rem; align-items:center; }
.card-icons span { margin-right: 0.0rem; }

/* Peso + planejado (linha de informação) */
.card-weight { font-size: 0.85rem; color:#333; margin-top: 0.25rem; }

/* ------------------------------
   PRIORIDADE (chips bonitos)
--------------------------------*/
.prio-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .15rem .5rem;
  border-radius: 9999px;
  font-size: .8rem;
  line-height: 1;
  font-weight: 700;
  border: 1px solid transparent;
}
.prio-dot {
  display:inline-block; width:.6rem; height:.6rem; border-radius:50%;
}

/* cores por nível */
.prio-low       { background:#e8f7ee; color:#0a7f3f; border-color:#b9ebcd; }
.prio-low .prio-dot { background:#16a34a; }

.prio-medium    { background:#fff8e6; color:#8a6d00; border-color:#ffe29e; }
.prio-medium .prio-dot { background:#f59e0b; }

.prio-high      { background:#ffefe8; color:#9a3412; border-color:#ffcfbf; }
.prio-high .prio-dot { background:#fb923c; }

.prio-immediate { background:#ffe8e8; color:#7f1d1d; border-color:#ffc1c1; }
.prio-immediate .prio-dot { background:#ef4444; }

/* ------------------------------
   RESUMO DE CHECKLIST (mini-lista)
--------------------------------*/
.card-checklist    { list-style: none; padding-left: 0.55rem; margin-top: 0.45rem; font-size: 0.8rem; }
.card-checklist li { display: flex; align-items: center; margin-bottom: 0.18rem; }
.card-checklist li.done span { text-decoration: line-through; color: #999; }
.card-checklist li input { margin-right: 0.3rem; }

/* ------------------------------
   BOTÕES “+”
--------------------------------*/
.add-card,
.add-list {
  background: rgba(0,0,0,0.08);
  padding: 0.5rem;
  border-radius: 3px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
}
.add-card:hover,
.add-list:hover { background: rgba(0,0,0,0.15); }
.add-list input {
  width: calc(100% - 4px);
  padding: 4px;
  margin-bottom: 0.5rem;
}

/* ------------------------------
   MODAIS (genéricos)
--------------------------------*/
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
}
.modal-content {
  background: #fff;
  width: 95%; max-width: 900px;
  margin: 40px auto;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.modal-content.large { max-width: 1000px; }
.close {
  position: absolute;
  top: 8px; right: 12px;
  font-size: 1.3rem;
  cursor: pointer;
}

/* ------------------------------
   FIELDSETS / FORMULÁRIOS
--------------------------------*/
fieldset {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
legend {
  padding: 0 0.5rem;
  font-weight: bold;
  font-size: 1.1rem;
}
.modal-content label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.modal-content input[type="text"],
.modal-content textarea,
.modal-content select,
.modal-content input[type="date"],
.modal-content input[type="number"],
.modal-content input[type="file"],
.modal-content input[type="email"] {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1.2rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Duplas lado a lado */
.select-pair,
.date-pair { display: flex; gap: 1rem; margin-bottom: 1rem; }
.select-pair label,
.date-pair label { flex: 1; }

/* NOVO: seletor de Pavimento no formulário do cartão */
#cardFloor { min-width: 140px; }

/* display percentual */
.percent-display { font-weight: bold; margin-bottom: 0.8rem; }

/* ------------------------------
   ANEXOS – pré-visualização
--------------------------------*/
.preview-img,
.attachment-preview img.preview-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
}
.attachment-preview { display: flex; flex-wrap: wrap; cursor: pointer; }
.attachment-preview ul { padding-left: 1.2rem; }
.attachment-preview ul li {
  font-size: 0.85rem;
  position: relative;
  padding-right: 20px;
}
.attachment-preview ul li .remove-attachment {
  position: absolute;
  right: 0; top: 0;
  cursor: pointer;
  color: #e53935;
}

/* ------------------------------
   CHECKLIST – cabeçalho e linhas
--------------------------------*/
.checklist-header,
#checklistItems .checklist-item {
  display: grid;
  grid-template-columns:
    2fr 1fr 1fr 60px 80px 80px 40px 40px 30px 30px 30px;
  gap: 0.5rem;
  align-items: center;
}
.checklist-header {
  padding: 0.6rem 0;
  background: #f7f7f7;
  border-bottom: 2px solid #ddd;
  font-size: 0.9rem;
  text-align: center;
}
.checklist-header span { display: flex; align-items: center; justify-content: center; }

#checklistItems .checklist-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}
#checklistItems .checklist-item:last-child { border-bottom: none; }
.checklist-item .item-text {
  font-weight: 500;
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* responsável / empreiteiro */
.checker { display: flex; flex-direction: column; align-items: center; }
.checker small {
  font-size: 0.75rem;
  color: #333;
  margin-top: 2px;
  line-height: 1;
}

/* percent wrapper */
.percent-wrapper { display: flex; align-items: center; }
.percent-wrapper input { width: 60px; }

/* esconder ano nos inputs date */
.checklist-item input[type="date"]::-webkit-datetime-edit-year-field {
  display: none;
}

/* inputs file invisíveis */
.checklist-item input.chk-photo-input,
.checklist-item input.chk-file-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* cor dos botões quando há anexos */
.checklist-item.has-photos .chk-photo-btn { color: #4caf50; }
.checklist-item.has-files  .chk-file-btn  { color: #ff9800; }

/* ------------------------------
   BOTÕES (gerais e checklist)
--------------------------------*/
#checklistItems button {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #555;
}
#checklistItems .remove-item { color: #e53935; }

.add-checklist-btn,
.actions button {
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  border-radius: 4px;
}
.add-checklist-btn {
  border: none;
  background: #0066cc;
  color: #fff;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 2rem;
}
button[type="submit"] {
  background: #0066cc;
  color: #fff;
  border: none;
  border-radius: 4px;
}
button#deleteCard {
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 4px;
}

/* ------------------------------
   CALENDÁRIO
--------------------------------*/
.calendar {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}
.calendar th {
  padding: 0.55rem 0;
  background: #ddd;
}
.calendar td {
  width: 14.28%;
  height: 80px;
  border: 1px solid #eee;
  vertical-align: top;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
.calendar td:hover { background: #f5f5f5; }
.calendar td span.day-num {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.85rem;
  font-weight: bold;
}
.calendar td.has-task      { background: rgba(0,102,204,0.2); }
.calendar td.has-checklist { background: rgba(0,153, 51,0.25); }
.calendar td.has-both      { background: rgba(128,0,128,0.25); }

#dayEvents     { padding: 0.5rem; border-top: 1px solid #ccc; }
#dayEvents h4  { margin: 0.5rem 0 0.3rem; }
#dayEvents ul  { padding-left: 1.2rem; }

/* barra colorida (máx. 5) */
.color-bar {
  width: 100%;
  height: 4px;
  margin-top: 2px;
  border-radius: 2px;
}

/* botão fechar calendário */
button#closeCalendarBtn {
  background: #777;
  color: #fff;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
}

/* Peso na lista diária do calendário */
#dayEvents .day-weight {
  color: #d97706;         /* laranja vibrante para chamar atenção */
  font-weight: 700;
  margin-left: .35rem;
}

/* ------------------------------
   QUICK PANEL (pessoas)
--------------------------------*/
.quick-panel {
  display: none;
  position: absolute;
  right: 10px;
  top: calc(100% + 8px);
  width: 420px;
  background: #fff;
  color: #222;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  z-index: 120;
  border: 1px solid #e2e8f0;
}
.quick-panel .qp-header {
  display:flex; align-items:center; justify-content: space-between;
  padding: .6rem .8rem;
  background:#f7fafc; border-bottom:1px solid #e2e8f0;
}
.quick-panel .qp-actions button {
  background: none; border: none; cursor: pointer; font-size: 1rem; margin-left: .25rem;
}
.quick-panel .qp-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
  padding: .8rem;
  max-height: 300px; overflow:auto;
}
.quick-panel .qp-section h4 { margin: .2rem 0 .5rem; font-size: .95rem; color:#004a7c; }
.quick-panel .qp-list { list-style: none; margin: 0; padding: 0; }
.quick-panel .qp-list li {
  border:1px solid #eaeaea; border-radius:6px; padding:.4rem .5rem; margin-bottom:.4rem; background:#fff;
}
.quick-panel .qp-list li .sm { display:block; font-size:.8rem; color:#555; }

/* ------------------------------
   MODAL – ORGANIZAR
--------------------------------*/
.order-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1rem;
}
.order-col h4 { margin-bottom: .5rem; }
.order-list { list-style: none; margin: 0; padding: 0; }
.order-list li {
  display:flex; align-items:center; justify-content: space-between;
  padding:.5rem .6rem; margin-bottom:.4rem; border: 1px solid #e5e7eb;
  border-radius:6px; background:#fff;
}
.order-list li .ord-title { flex:1; margin-right:.5rem; }
.order-list li .ord-actions button {
  background:none; border: none; cursor:pointer; font-size:1.1rem; margin-left:.25rem;
}
.order-list li.active { outline:2px solid #3182ce; }

/* DnD dentro do modal de organização */
.order-list li[draggable="true"] { cursor: grab; }
.order-list li.dragging { opacity: .5; }
.order-placeholder {
  height: 38px;
  margin-bottom:.4rem;
  border:2px dashed #cbd5e1;
  border-radius:6px;
}

/* Ações em lote */
.bulk-grid {
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.bulk-line { display:flex; gap:1rem; flex-wrap: wrap; margin-bottom:.5rem; }
.bulk-confirm input { max-width: 320px; }

/* ------------------------------
   VINCULAR SERVIÇOS (lista)
--------------------------------*/
#serviceLinkList .svc-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .75rem;
  align-items: center;
  padding: .6rem .4rem;
  border-bottom: 1px dashed #e5e7eb;
}
#serviceLinkList .svc-row .svc-name {
  font-weight: 700; color: #0f172a;
}
#serviceLinkList select { min-height: 120px; }

/* ===== NOVO: V2 com abas / escopos ===== */
.svc-tabs{
  display:flex; gap:.5rem; margin:.5rem 0 .75rem;
}
.svc-tab{
  padding:.45rem .8rem; border:1px solid #dbe4ff; border-radius:10px;
  background:#eef2ff; cursor:pointer; font-weight:600;
}
.svc-tab.active{ background:#dbe4ff; }
.svc-panel{ display:none; }
.svc-panel.active{ display:block; }

.hint{ font-size:.9rem; color:#6b7280; margin:.25rem 0 .6rem; }

.svc-towers-toolbar,
.svc-floors-toolbar{
  display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin-bottom:.6rem;
}
.svc-actions{ display:flex; gap:.4rem; margin-left:auto; }
.svc-actions button{
  padding:.45rem .8rem; border:1px solid #dbe4ff; border-radius:10px; background:#eef2ff; cursor:pointer;
}
.svc-list .svc-row{
  display:grid; grid-template-columns: 1fr 1fr 1fr; gap:.6rem; align-items:center;
  padding:.5rem 0; border-bottom:1px dashed #e5e7eb;
}
.svc-list .svc-name{ font-weight:700; color:#0f172a; }
.svc-list select[multiple]{ min-height:120px; }

/* ------------------------------
   RESUMO (tabela)
--------------------------------*/
.summary-controls {
  display:flex; flex-wrap:wrap; gap: 1rem; align-items:center; margin-bottom: .8rem;
}
.summary-controls .share-toggle { margin-left: auto; font-size: .95rem; }
.summary-table { width:100%; border-collapse: collapse; }
.summary-table th, .summary-table td {
  border: 1px solid #e5e7eb; padding: .5rem .6rem; text-align:left;
}
.summary-table th { background: #f8fafc; }
.summary-table tbody tr:nth-child(even){ background:#fafafa; }
.right { text-align:right; }

/* ========================================================================
   PAINEL DE ESTATÍSTICAS DE SERVIÇOS E PERCENTUAIS DA OBRA
   ======================================================================== */
.stats-panel {
  flex: 0 0 320px;
  min-width: 320px;
  max-width: 320px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-left: 1rem;
  align-self: flex-start;
  position: sticky;
  top: 1rem;
}

.stats-section {
  margin-bottom: 2rem;
}

.stats-section:last-child {
  margin-bottom: 0;
}

.stats-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

/* Grid de Serviços */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stat-item {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border: 2px solid #e5e7eb;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

/* Cores específicas por status */
.stat-executado {
  border-color: #10b981;
}

.stat-executado .stat-value {
  color: #10b981;
}

.stat-em-execucao {
  border-color: #f59e0b;
}

.stat-em-execucao .stat-value {
  color: #f59e0b;
}

.stat-a-executar {
  border-color: #ef4444;
}

.stat-a-executar .stat-value {
  color: #ef4444;
}

.stat-total {
  border-color: #3b82f6;
  grid-column: 1 / -1;
}

.stat-total .stat-value {
  color: #3b82f6;
}

/* Grid de Percentuais */
.percentual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.percentual-item {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  border: 2px solid #e5e7eb;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.percentual-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.percentual-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.percentual-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.percentual-executado {
  border-color: #10b981;
}

.percentual-executado .percentual-value {
  color: #10b981;
}

.percentual-a-executar {
  border-color: #ef4444;
}

.percentual-a-executar .percentual-value {
  color: #ef4444;
}

/* Responsividade */
@media (max-width: 1400px) {
  .stats-panel {
    flex: 0 0 280px;
    min-width: 280px;
    max-width: 280px;
    padding: 1.25rem;
  }
  
  .stat-value {
    font-size: 1.75rem;
  }
  
  .percentual-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 1200px) {
  .stats-panel {
    display: none; /* Oculta em telas menores para não atrapalhar */
  }
}

/* ======================================================================
   FIM DO ARQUIVO
====================================================================== */
