
.rh-stat-value:empty::after { content: "0"; }

/* Reserva espaço inferior pros widgets flutuantes (sino de notificações e
   acessibilidade) não cobrirem o conteúdo no canto inferior direito */
:is(#view-portal, #view-admin, #view-operator, #view-driver, #view-casaapoio,
    #view-transporte, #view-servidor, #view-rh, #view-reception, #view-capacitacao,
    #view-intranet, #view-ubs-intranet, #view-ubs-prontuario)
    > .panel-container { padding-bottom: 104px; }

/* Importação RH: mantém a frase do checkbox inteira numa linha só,
   em vez de picá-la no meio entre o seletor de arquivo e o botão */
#view-rh label:has(> #rh-import-clear-prev) { white-space: nowrap; flex-shrink: 0; }

/* ============================================================
   Padronização dos painéis internos — 2026-06-01
   (1) Tamanho/largura igual em todos
   (2) Tabelas com acabamento consistente
   (Regulação Assistencial intencionalmente fora do escopo)
   ============================================================ */

/* (1) TAMANHO: todos os painéis com a mesma largura máxima, centralizados
   e com o mesmo padding lateral (corrige Recepção 1320, Capacitação 1100, etc.) */
/* views ja migradas p/ Aurora saem daqui: os 3 !important (max-width:1500px +
   padding lateral 32px) venciam o layout proprio do kit */
:is(#view-driver, #view-casaapoio, #view-transporte, #view-capacitacao,
    #view-ubs-prontuario) > .panel-container {
  max-width: 1500px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 32px !important;
  padding-right: 32px !important;
}

/* (2) TABELAS: container arredondado, cabeçalho destacado, linhas separadas e hover */
:is(#view-portal, #view-admin, #view-operator, #view-driver, #view-casaapoio,
    #view-transporte, #view-servidor, #view-rh, #view-reception, #view-capacitacao,
    #view-intranet, #view-ubs-intranet, #view-ubs-prontuario) table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
:is(#view-portal, #view-admin, #view-operator, #view-driver, #view-casaapoio,
    #view-transporte, #view-servidor, #view-rh, #view-reception, #view-capacitacao,
    #view-intranet, #view-ubs-intranet, #view-ubs-prontuario) table thead th {
  background: #f6f7f3;
  color: var(--primary-dark);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
:is(#view-portal, #view-admin, #view-operator, #view-driver, #view-casaapoio,
    #view-transporte, #view-servidor, #view-rh, #view-reception, #view-capacitacao,
    #view-intranet, #view-ubs-intranet, #view-ubs-prontuario) table td {
  padding: 11px 14px;
  border-bottom: 1px solid #ecf0e5;
  font-size: .86rem;
}
:is(#view-portal, #view-admin, #view-operator, #view-driver, #view-casaapoio,
    #view-transporte, #view-servidor, #view-rh, #view-reception, #view-capacitacao,
    #view-intranet, #view-ubs-intranet, #view-ubs-prontuario) table tbody tr:last-child td {
  border-bottom: none;
}
:is(#view-portal, #view-admin, #view-operator, #view-driver, #view-casaapoio,
    #view-transporte, #view-servidor, #view-rh, #view-reception, #view-capacitacao,
    #view-intranet, #view-ubs-intranet, #view-ubs-prontuario) table tbody tr:hover td {
  background: #f7f8f5;
}

/* (3) TAMANHO igual também para: Regulação Assistencial, Kanban e Faturamento.
   reg-shell era 1540, reg-task-shell (kanban) era 1840, faturamento full-width —
   todos passam para a mesma largura padrão (1500, centralizados, gap lateral de 32). */
#view-regulacao .reg-shell,
#view-regulacao .reg-task-shell {
  width: min(1500px, calc(100vw - 64px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
#view-faturamento > div {
  max-width: 1500px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 32px !important;
  padding-right: 32px !important;
  box-sizing: border-box !important;
}

/* ============================================================
   Cabeçalho da Regulação (assistencial + kanban) no roxo padrão
   — era roxo→azul (#124c8a); passa ao mesmo gradiente dos demais painéis.
   ============================================================ */
#view-regulacao .reg-header {
  background:
    radial-gradient(circle at 85% -40%, rgba(230, 184, 0, 0.28), transparent 42%),
    linear-gradient(125deg, var(--primary-dark) 0%, var(--primary) 56%, var(--primary-light) 100%) !important;
}

/* ============================================================
   Transição entre painéis mais fluida.
   A infra já existe (switchView adiciona .is-entering em cada troca e
   respeita "reduzir movimento"); aqui só suavizamos duração/easing/curva.
   ============================================================ */
.view-section.active.is-entering {
  animation: panel-enter-smooth .42s cubic-bezier(.22, 1, .36, 1) !important;
}
@keyframes panel-enter-smooth {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Mobile (<=640px): visual app-like nos painéis do Motorista,
   Servidor (acesso do motorista) e Paciente (portal).
   ============================================================ */
@media (max-width: 640px) {
  /* Motorista + Servidor — cabeçalho compacto e botões uniformes */
  :is(#view-driver, #view-servidor) > .panel-container { padding: 12px !important; }
  :is(#view-driver, #view-servidor) > .panel-container > header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 16px 16px 14px !important;
    border-radius: 16px !important;
    margin-bottom: 14px !important;
  }
  :is(#view-driver, #view-servidor) > .panel-container > header h2 { font-size: 1.18rem !important; }
  :is(#view-driver, #view-servidor) > .panel-container > header > div:last-child,
  #view-servidor .intranet-header-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
  }
  :is(#view-driver, #view-servidor) > .panel-container > header .btn,
  #view-servidor .intranet-header-actions .btn {
    width: 100% !important;
    padding: 11px 8px !important;
    font-size: 0.88rem !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
  }
  :is(#view-driver, #view-servidor) .card { padding: 15px !important; border-radius: 14px !important; }
  /* tabelas roláveis horizontalmente em vez de espremer/cortar */
  :is(#view-driver, #view-servidor) table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Paciente (portal) — cabeçalho mais limpo, sem e-mail estourando */
  #view-portal > .panel-container { padding: 12px !important; }
  #view-portal > .panel-container > header,
  #view-portal .portal-header {
    padding: 16px !important;
    border-radius: 16px !important;
  }
  #view-portal [id="portal-user-info"] span { word-break: break-word !important; }
  #view-portal .card { padding: 15px !important; border-radius: 14px !important; }
}

/* ============================================================
   Portal do Paciente — cards branco puro destacados sobre o fundo
   colorido (mesmo padrão visual da Regulação Assistencial), mais
   intuitivo. Vale em todas as larguras.
   ============================================================ */
#view-portal .card,
#view-portal .portal-collapsible-card {
  background: #fff !important;
  border: 1px solid #e2e5dd !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(39,49,22,0.07) !important;
}
#view-portal .portal-calendar-day {
  border-radius: 10px !important;
  transition: background .15s ease, transform .15s ease !important;
}
#view-portal .portal-calendar-day:not(.is-empty):hover {
  background: #e9ede3 !important;
  transform: translateY(-1px) !important;
}

/* ============================================================
   Fluxo de atendimento da UBS (Fase 2) — board + cores de risco
   ============================================================ */
#view-ubs-clinical .ubs-flow-board {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 16px !important;
}
.ubs-flow-col {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.ubs-flow-col > header {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; color: var(--primary-dark);
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #eaece6;
}
.ubs-flow-col > header span {
  background: #ecf0e5; color: #4d5243; border-radius: 999px;
  padding: 1px 9px; font-size: .78rem; font-weight: 700;
}
.ubs-flow-col-body { display: flex; flex-direction: column; gap: 10px; min-height: 56px; }
.ubs-flow-card {
  background: #fff; border: 1px solid #eef0f4; border-left: 4px solid #c5d1b0;
  border-radius: 10px; padding: 11px 13px;
}
.ubs-flow-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ubs-flow-card > header strong { font-size: .92rem; color: #212717; }
.ubs-flow-risco { font-size: .67rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ubs-flow-card-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ubs-flow-triagem-resumo { background: #f7f9f4; border: 1px solid #eef0f4; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
/* cores de risco (classificacao Manchester / MS) */
.risco-vermelho { background: #fdeef0; color: #b91c1c; }  .ubs-flow-card-risco-vermelho { border-left-color: #e0445a; }
.risco-laranja  { background: #ffedd5; color: #c2410c; }  .ubs-flow-card-risco-laranja  { border-left-color: #f97316; }
.risco-amarelo  { background: #fef9c3; color: #a16207; }  .ubs-flow-card-risco-amarelo  { border-left-color: #eab308; }
.risco-verde    { background: #eafaf0; color: #1f8a5b; }  .ubs-flow-card-risco-verde    { border-left-color: #22c55e; }
.risco-azul     { background: #eef4fd; color: #1d4ed8; }  .ubs-flow-card-risco-azul     { border-left-color: #3a6fd0; }
.risco-na       { background: #ecf0e5; color: #5b6250; }  .ubs-flow-card-risco-na       { border-left-color: #c5d1b0; }

/* ===== Kanban Regulação — protocolo compacto + modais mais largos no desktop ===== */
.reg-task-protocol { font-size: 10px !important; padding: 1px 6px !important; opacity: .85; }
.reg-task-protocol i, .reg-task-protocol svg { width: 11px !important; height: 11px !important; }
.reg-task-protocol-banner { padding: 6px 10px !important; }
.reg-task-protocol-banner strong { font-size: 12px !important; }
@media (min-width: 769px) {
  #reg-modal .modal-box { max-width: 780px !important; width: 92% !important; }
  #ubs-clinical-modal .modal-box, .ubs-clinical-modal-box { max-width: 1180px !important; width: 96% !important; }
}

/* ===== Kanban — card minimalista + modal tratar ===== */
.reg-task-card-min { display:flex; flex-direction:column; gap:8px; align-items:stretch; }
.reg-task-card-min .reg-task-min-date { display:flex; align-items:center; gap:5px; font-size:11px; color:#5b6250; }
.reg-task-card-min .reg-task-min-date svg, .reg-task-card-min .reg-task-min-date i { width:12px; height:12px; }
.reg-task-card-min .reg-task-open-btn { width:100%; justify-content:center; margin-top:2px; }
.reg-treat-info { background:#f7f8f5; border:1px solid #e7e9e3; border-radius:8px; padding:10px 12px; margin-bottom:10px; }
.reg-treat-actions { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }

/* ===== Kanban — admin de categorias/SLA (layout limpo + edição) ===== */
.reg-cat-panel { max-width:100%; padding:4px 2px; }
.reg-cat-intro { margin:0 0 14px; color:#5b6250; font-size:13px; }
.reg-cat-panel input { padding:8px 11px; border:1px solid #e0e7d4; border-radius:8px; font-size:13px; box-sizing:border-box; }
.reg-cat-panel input:focus { outline:none; border-color:#638625; box-shadow:0 0 0 3px rgba(99,134,37,.12); }
.reg-cat-newform { display:flex; gap:8px; align-items:center; margin:0 0 16px; }
.reg-cat-newform input { flex:1; }
.reg-cat-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:14px; align-items:start; }
.reg-cat-item { border:1px solid #e8eaf0; border-radius:12px; padding:14px 16px; background:#fff; }
.reg-cat-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.reg-cat-head strong { font-size:.98rem; color:#212717; }
.reg-cat-headacts, .reg-cat-subacts { display:inline-flex; gap:4px; flex:0 0 auto; }
.reg-cat-iconbtn { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border:1px solid #e0e7d4; background:#fff; border-radius:8px; color:#5b6250; cursor:pointer; transition:all .12s; }
.reg-cat-iconbtn:hover { border-color:#c5d1b0; color:#212717; background:#f7f9f4; }
.reg-cat-iconbtn svg, .reg-cat-iconbtn i { width:14px; height:14px; }
.reg-cat-subs { display:grid; gap:6px; margin:12px 0; }
.reg-cat-subrow { display:flex; align-items:center; gap:10px; padding:8px 11px; background:#fff; border:1px solid #ececf2; border-radius:9px; }
.reg-cat-subname { font-weight:600; font-size:13px; color:#212717; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reg-cat-slatag { font-size:11px; font-weight:800; color:#4a5f25; background:#ebf5db; padding:2px 9px; border-radius:999px; white-space:nowrap; }
.reg-cat-empty { color:#8d9977; font-size:12.5px; padding:6px 2px; }
.reg-cat-subform { display:flex; gap:8px; align-items:center; margin-top:12px; padding-top:12px; border-top:1px dashed #eef1f6; }
.reg-cat-subform input:first-of-type { flex:1; }
.reg-cat-subform input[type=number] { width:110px; flex:0 0 auto; }
.reg-cat-editform { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
/* evita campos "vazando" do card: inputs sem a margem global e sem encolher abaixo de 0 */
.reg-cat-panel input, .reg-cat-panel select { margin:0; min-width:0; }
.reg-cat-subform, .reg-cat-newform { flex-wrap:wrap; }
.reg-cat-subrow { flex-wrap:wrap; }
.reg-cat-editform input { min-width:0; }
/* tabela de campos do construtor de formulário: rola na horizontal se faltar espaço, sem estourar o modal */
#reg-modal #fb-fields { overflow-x:auto; }
#reg-modal .reg-fb-table input, #reg-modal .reg-fb-table select { margin:0; }
.reg-cat-iconbtn.has-form { color:#4a5f25; border-color:#cae797; background:#ebf5db; }
.reg-cat-iconbtn.has-form:hover { background:#dcefba; }
/* Anexos múltiplos (stage antes de enviar) */
#reg-modal .reg-task-staged-list:not(:empty) { display:flex; flex-direction:column; gap:8px; margin:10px 0 12px; }
#reg-modal .reg-task-staged-head { font-size:12px; font-weight:800; color:#4d5243; display:flex; align-items:center; gap:6px; margin-bottom:2px; }
#reg-modal .reg-task-staged-head svg, #reg-modal .reg-task-staged-head i { width:14px; height:14px; color:#8d9977; }
#reg-modal .reg-task-staged-item { display:flex; align-items:center; gap:10px; background:#fff; border:1px solid #e6e9f0; border-radius:10px; padding:8px 10px; }
#reg-modal .reg-task-staged-icon { width:34px; height:34px; border-radius:8px; background:#ebf5db; color:#4a5f25; display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
#reg-modal .reg-task-staged-icon svg, #reg-modal .reg-task-staged-icon i { width:17px; height:17px; }
#reg-modal .reg-task-staged-info { flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
#reg-modal .reg-task-staged-info strong { font-size:13px; color:#24281d; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#reg-modal .reg-task-staged-info small { font-size:11.5px; color:#8d9977; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#reg-modal .reg-task-attachment-add { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:4px; }
#reg-modal .reg-task-link-add { display:flex; flex-wrap:wrap; gap:8px; align-items:center; flex:1; min-width:240px; }
#reg-modal .reg-task-link-add .au-fld { flex:1 1 140px; min-width:0; }
#reg-modal .reg-task-link-add input { margin:0; min-width:0; width:100%; }
.reg-cat-editform input:first-of-type { flex:1; }
.reg-cat-editform input[type=number] { width:110px; flex:0 0 auto; }

/* Trava o scroll do fundo enquanto um modal da regulação está aberto (centraliza sem desvio da barra de rolagem) */
body.reg-modal-open { overflow: hidden; }

/* ===== Modal "tratar tarefa" — info mais legível ===== */
#view-regulacao .reg-treat-info, #reg-modal .reg-treat-info { background:#f7f9f4; border:1px solid #eef1f6; border-radius:12px; padding:14px 16px; margin-bottom:14px; }
.reg-treat-title { font-size:1rem; font-weight:800; color:#212717; line-height:1.3; margin-bottom:8px; }
.reg-treat-meta { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.reg-treat-chip { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; color:#4d5243; background:#fff; border:1px solid #e0e7d4; border-radius:999px; padding:3px 10px; }
.reg-treat-chip svg, .reg-treat-chip i { width:12px; height:12px; }
.reg-treat-chip.is-overdue { background:#fdeef0; color:#b91c1c; border-color:#f7d3d8; }
.reg-treat-desc { white-space:pre-line; background:#fff; border:1px solid #eef1f6; border-radius:8px; padding:10px 12px; font-size:13px; color:#4d5243; line-height:1.5; margin:0 0 10px; }
.reg-treat-updated { font-size:11.5px; color:#8d9977; }

/* ===== Modal "Agendamentos da Recepção" — layout alinhado ===== */
#modal-reception-appointments .rec-appt-header { margin-bottom: 14px; }
#modal-reception-appointments .rec-appt-header h3 { font-size: 1.15rem; font-weight: 800; color: #212717; }
#modal-reception-appointments .rec-appt-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #eef1f6; }
#modal-reception-appointments .rec-appt-field { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; font-weight: 700; color: #4d5243; }
#modal-reception-appointments .rec-appt-field input { margin: 0; padding: 8px 10px; border: 1px solid #e0e7d4; border-radius: 8px; font-size: 13px; box-sizing: border-box; }
#modal-reception-appointments .rec-appt-field input[type="text"] { width: 190px; }
#modal-reception-appointments .rec-appt-field input[type="date"] { width: 165px; }
#modal-reception-appointments .rec-appt-search { min-height: 38px; }
#modal-reception-appointments .rec-appt-count { margin-left: auto; color: #5b6250; white-space: nowrap; align-self: center; }
#modal-reception-appointments .rec-appt-table-wrap { overflow: auto; max-height: 65vh; }
#modal-reception-appointments #reception-report-table { width: 100%; }
@media (max-width: 640px) {
  #modal-reception-appointments .rec-appt-field input[type="text"],
  #modal-reception-appointments .rec-appt-field input[type="date"] { width: 100%; }
  #modal-reception-appointments .rec-appt-field { flex: 1 1 100%; }
  #modal-reception-appointments .rec-appt-count { margin-left: 0; flex-basis: 100%; }
}

/* ===== Modal "Histórico de Senhas" (operador) ===== */
#modal-op-history .op-hist-header { margin-bottom: 14px; }
#modal-op-history .op-hist-header h3 { font-size: 1.15rem; font-weight: 800; color: #212717; }
#modal-op-history .op-hist-searchbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #eef1f6; }
#modal-op-history .op-hist-searchbar input { flex: 1; margin: 0; padding: 9px 11px; border: 1px solid #e0e7d4; border-radius: 8px; font-size: 13px; box-sizing: border-box; }
#modal-op-history .op-hist-searchbar input:focus { outline: none; border-color: #638625; box-shadow: 0 0 0 3px rgba(99,134,37,.12); }
#modal-op-history .op-hist-list { max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
#modal-op-history .op-hist-footer { display: flex; justify-content: flex-end; margin-top: 14px; }
#modal-op-history .op-hist-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; text-align: left; padding: 12px 14px; margin: 0; }
#modal-op-history .op-hist-main { flex: 1; min-width: 0; text-align: left; }
#modal-op-history .op-hist-title { font-size: 0.95rem; color: #212717; }
#modal-op-history .op-hist-dept { color: #8d9977; font-weight: 500; }
#modal-op-history .op-hist-cpf { font-size: 0.8rem; font-weight: 700; color: #4d5243; margin-top: 2px; }
#modal-op-history .op-hist-lines { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
#modal-op-history .op-hist-lines span { font-size: 0.74rem; color: #8d9977; line-height: 1.45; }
#modal-op-history .op-hist-note { color: #e67e22 !important; }
#modal-op-history .op-hist-call { color: #3a6fd0 !important; }
#modal-op-history .op-hist-fin { color: #1f9d57 !important; }
#modal-op-history .op-hist-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
#modal-op-history .op-hist-status-badge { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #e0e7d4; color: #4d5243; white-space: nowrap; }
#modal-op-history .op-hist-status-closed { background: #e0e7d4; color: #4d5243; }
#modal-op-history .op-hist-status-served { background: #eef4fd; color: #1e40af; }
#modal-op-history .op-hist-status-waiting { background: #fef9c3; color: #854d0e; }

/* ===== Comemoração de aniversário ===== */
.birthday-banner {
  position: fixed; top: 18px; left: 50%; transform: translate(-50%, -150%);
  z-index: 100000; display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 999px;
  background: linear-gradient(135deg, #536f23 0%, #627e30 50%, #f59e0b 100%);
  color: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: 0 12px 30px -8px rgba(83,111,35,0.5);
  opacity: 0; transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .5s; white-space: nowrap;
  pointer-events: none;
}
.birthday-banner.show { transform: translate(-50%, 0); opacity: 1; }
.birthday-banner .bd-emoji { font-size: 1.2rem; display: inline-block; animation: bdBounce 1s ease-in-out infinite; }
@keyframes bdBounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
@media (max-width:640px){ .birthday-banner { font-size:.85rem; padding:10px 16px; white-space:normal; max-width:92vw; text-align:center; } }

/* ===== Dashboard do Kanban — filtros + comparativo mensal ===== */
.reg-task-dashboard-filters { display:flex; gap:10px; flex-wrap:wrap; }
.reg-task-dashboard-filter { display:flex; flex-direction:column; gap:4px; }
.reg-task-dashboard-filter > span { display:flex; align-items:center; gap:5px; font-size:.72rem; font-weight:800; color:#5b6250; text-transform:uppercase; letter-spacing:.02em; }
.reg-task-dashboard-filter > span i { width:14px; height:14px; }
.reg-task-dashboard-filter select { border:1px solid var(--border,#e0e7d4); border-radius:9px; padding:8px 12px; font-size:.85rem; background:#fff; color:#212717; min-width:190px; font-weight:600; }
.reg-task-dashboard-monthly { margin-bottom:16px; }
.monthly-card { padding:16px 18px; }
.monthly-card > header { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:14px; }
.monthly-card > header strong { font-size:1rem; color:#24281d; }
.monthly-card > header span { font-size:.76rem; color:#8d9977; }
.reg-mc-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:14px; }
.reg-mc-metric { background:#f7f9f4; border:1px solid #eef2f7; border-radius:12px; padding:12px 14px; }
.reg-mc-metric-label { display:flex; align-items:center; gap:6px; font-size:.74rem; font-weight:700; color:#4d5243; }
.reg-mc-metric-value { display:flex; align-items:center; gap:10px; margin:6px 0 2px; }
.reg-mc-metric-value strong { font-size:1.7rem; line-height:1; color:#212717; }
.reg-mc-metric small { font-size:.72rem; color:#8d9977; }
.reg-mc-dot { display:inline-block; width:10px; height:10px; border-radius:3px; }
.reg-mc-dot-created { background:#4a5f25; }
.reg-mc-dot-done { background:#1f9d57; }
.reg-delta { display:inline-flex; align-items:center; gap:3px; font-size:.78rem; font-weight:800; padding:2px 8px; border-radius:999px; }
.reg-delta i { width:14px; height:14px; }
.reg-delta small { font-weight:600; opacity:.85; }
.reg-delta-up { background:#eafaf0; color:#1f8a5b; }
.reg-delta-down { background:#fdeef0; color:#b91c1c; }
.reg-delta-flat { background:#ecf0e5; color:#5b6250; }
.reg-mc-svg { width:100%; max-width:none; height:auto; display:block; margin:0 auto; }
.monthly-card { display:flex; flex-direction:column; }
.monthly-card .reg-mc { flex:1; display:flex; flex-direction:column; justify-content:center; }
.reg-mc-grid { stroke:#eef2f7; stroke-width:1; }
.reg-mc-baseline { stroke:#c5d1b0; stroke-width:1.5; }
.reg-mc-axis { fill:#8d9977; font-size:10px; }
.reg-mc-month.is-current { fill:#4a5f25; font-weight:800; }
.reg-mc-bar { transition:opacity .15s; }
.reg-mc-bar:hover { opacity:.8; }
.reg-mc-created { fill:#7dab2e; }
.reg-mc-created.is-current { fill:#4a5f25; }
.reg-mc-done { fill:#86efac; }
.reg-mc-done.is-current { fill:#1f9d57; }
.reg-mc-legend { display:flex; gap:18px; justify-content:center; margin-top:10px; }
.reg-mc-legend span { display:flex; align-items:center; gap:6px; font-size:.78rem; color:#4d5243; font-weight:600; }
@media (max-width:640px){ .reg-mc-summary { grid-template-columns:1fr; } }

/* ===== Kanban — layout do quadro aprimorado ===== */
#view-regulacao .reg-kanban-column { position:relative; background:#fafbf9; border:1px solid #e6e9e1; border-radius:12px; padding:14px 12px 12px; }
#view-regulacao .reg-kanban-column::before { content:""; position:absolute; top:0; left:0; right:0; height:4px; border-radius:12px 12px 0 0; background:#c5d1b0; }
#view-regulacao .reg-kanban-column[data-status="todo"]::before { background:#8d9977; }
#view-regulacao .reg-kanban-column[data-status="doing"]::before { background:#3a6fd0; }
#view-regulacao .reg-kanban-column[data-status="done"]::before { background:#1f9d57; }
#view-regulacao .reg-kanban-column[data-status="pending"]::before { background:#f59e0b; }
#view-regulacao .reg-kanban-column > header strong { display:flex; align-items:center; gap:7px; font-size:.92rem; font-weight:800; }
#view-regulacao .reg-kanban-column > header strong::before { content:""; width:9px; height:9px; border-radius:3px; background:#c5d1b0; }
#view-regulacao .reg-kanban-column[data-status="todo"] > header strong::before { background:#8d9977; }
#view-regulacao .reg-kanban-column[data-status="doing"] > header strong::before { background:#3a6fd0; }
#view-regulacao .reg-kanban-column[data-status="done"] > header strong::before { background:#1f9d57; }
#view-regulacao .reg-kanban-column[data-status="pending"] > header strong::before { background:#f59e0b; }
#view-regulacao .reg-kanban-column > header span { background:#eef2f7; color:#4d5243; }
#view-regulacao .reg-kanban-column[data-status="doing"] > header span { background:#eef4fd; color:#1e40af; }
#view-regulacao .reg-kanban-column[data-status="done"] > header span { background:#eafaf0; color:#1f8a5b; }
#view-regulacao .reg-kanban-column[data-status="pending"] > header span { background:#fef3c7; color:#92400e; }

#view-regulacao .reg-task-card-min { border:1px solid #e8eaf0; border-left:4px solid #8d9977; border-radius:10px; padding:11px 12px; box-shadow:0 2px 6px rgba(15,23,42,.05); transition:transform .12s, box-shadow .12s; gap:9px; }
#view-regulacao .reg-task-card-min:hover { transform:translateY(-2px); box-shadow:0 10px 22px rgba(15,23,42,.10); }
#view-regulacao .reg-task-card-doing { border-left-color:#3a6fd0; }
#view-regulacao .reg-task-card-done { border-left-color:#1f9d57; opacity:.92; }
#view-regulacao .reg-task-card-pending { border-left-color:#f59e0b; }
#view-regulacao .reg-task-card-min.is-overdue { border-left-color:#e0445a; background:#fff8f5; }
#view-regulacao .reg-task-card-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
#view-regulacao .reg-task-card-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; }
#view-regulacao .reg-task-card-min .reg-task-min-date { display:inline-flex; align-items:center; gap:5px; font-size:11px; color:#5b6250; margin:0; }
#view-regulacao .reg-task-card-min .reg-task-min-date svg, #view-regulacao .reg-task-card-min .reg-task-min-date i { width:12px; height:12px; }
#view-regulacao .reg-task-prio { font-size:9.5px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; padding:2px 7px; border-radius:999px; background:#eef2f7; color:#4d5243; white-space:nowrap; }
#view-regulacao .reg-task-prio-baixa { background:#eafaf0; color:#1f8a5b; }
#view-regulacao .reg-task-prio-normal { background:#eef4fd; color:#1e40af; }
#view-regulacao .reg-task-prio-alta { background:#ffedd5; color:#9a3412; }
#view-regulacao .reg-task-prio-urgente { background:#fdeef0; color:#b91c1c; }
#view-regulacao .reg-task-avatar-sm { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; background:#4a5f25; color:#fff; font-size:9.5px; font-weight:800; }
#view-regulacao .reg-task-overdue-tag { display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:800; color:#b91c1c; }
#view-regulacao .reg-task-overdue-tag svg, #view-regulacao .reg-task-overdue-tag i { width:12px; height:12px; }
#view-regulacao .reg-task-open-btn { width:100%; justify-content:center; gap:5px; }
#view-regulacao .reg-task-open-btn svg, #view-regulacao .reg-task-open-btn i { width:14px; height:14px; }
#view-regulacao .reg-task-card-done .reg-task-open-btn { background:#212717; }

/* ===== Coluna "Transferidas" — acompanhamento de tarefas enviadas a outro departamento ===== */
#view-regulacao .reg-kanban-column-transferred { background:#f7f9f4; border:1px dashed #c5d1b0; }
#view-regulacao .reg-kanban-column-transferred > header strong { display:inline-flex; align-items:center; gap:6px; color:#536f23; }
#view-regulacao .reg-kanban-column-transferred > header strong svg, #view-regulacao .reg-kanban-column-transferred > header strong i { width:14px; height:14px; }
#view-regulacao .reg-task-card-transferred { border-left-color:#536f23; cursor:default; }
#view-regulacao .reg-task-card-transferred:hover { transform:none; box-shadow:0 2px 6px rgba(15,23,42,.05); }
#view-regulacao .reg-task-transferred-title { font-size:12px; font-weight:600; color:#212717; line-height:1.3; }
#view-regulacao .reg-task-transferred-dest { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; color:#536f23; }
#view-regulacao .reg-task-transferred-dest svg, #view-regulacao .reg-task-transferred-dest i { width:12px; height:12px; }
#view-regulacao .reg-task-status-pill { font-size:9.5px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; padding:2px 7px; border-radius:999px; background:#eef2f7; color:#4d5243; white-space:nowrap; }
#view-regulacao .reg-task-status-pill.reg-task-status-doing { background:#eef4fd; color:#1e40af; }
#view-regulacao .reg-task-status-pill.reg-task-status-done { background:#eafaf0; color:#1f8a5b; }
#view-regulacao .reg-task-status-pill.reg-task-status-pending { background:#fef3c7; color:#92400e; }
#view-regulacao .reg-task-status-pill.reg-task-status-todo { background:#e0e7d4; color:#4d5243; }

/* ===== Kanban — melhorias visuais (título, prazo, prioridade, filtros, WIP, drag&drop) ===== */
/* V1 — título no card */
#view-regulacao .reg-task-card-title { font-size:12.5px; font-weight:700; color:#212717; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
/* categoria no card */
#view-regulacao .reg-task-card-cat { display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:700; color:#4a5f25; background:#ebf5db; padding:2px 7px; border-radius:6px; align-self:flex-start; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#view-regulacao .reg-task-card-cat svg, #view-regulacao .reg-task-card-cat i { width:11px; height:11px; flex:0 0 auto; }
/* V2 — prazo com contagem regressiva */
#view-regulacao .reg-task-due { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:2px 7px; border-radius:6px; align-self:flex-start; background:#eef2f7; color:#4d5243; }
#view-regulacao .reg-task-due svg, #view-regulacao .reg-task-due i { width:12px; height:12px; }
#view-regulacao .reg-task-due-soon { background:#fef3c7; color:#92400e; }
#view-regulacao .reg-task-due-overdue { background:#fdeef0; color:#b91c1c; }
#view-regulacao .reg-task-due-done { background:#eafaf0; color:#1f8a5b; }
/* V3 — borda esquerda por prioridade (atrasada continua vermelha via is-overdue) */
#view-regulacao .reg-task-card-prio-baixa { border-left-color:#8d9977; }
#view-regulacao .reg-task-card-prio-normal { border-left-color:#3a6fd0; }
#view-regulacao .reg-task-card-prio-alta { border-left-color:#f59e0b; }
#view-regulacao .reg-task-card-prio-urgente { border-left-color:#e0445a; }
/* V5 — nome do responsável + aviso sem responsável */
#view-regulacao .reg-task-min-assignee { display:inline-flex; align-items:center; gap:5px; font-size:11px; color:#4d5243; font-weight:600; }
#view-regulacao .reg-task-assignee-name { max-width:96px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#view-regulacao .reg-task-noassignee { color:#b91c1c; font-weight:700; }
#view-regulacao .reg-task-noassignee svg, #view-regulacao .reg-task-noassignee i { width:13px; height:13px; }
/* V4 — estado vazio acionável */
#view-regulacao .reg-empty-add { display:flex; align-items:center; justify-content:center; gap:6px; width:100%; padding:10px; border:1.5px dashed #c5d1b0; border-radius:10px; background:transparent; color:#4a5f25; font-weight:700; font-size:12px; cursor:pointer; transition:background .12s, border-color .12s; }
#view-regulacao .reg-empty-add:hover { background:#ebf5db; border-color:#638625; }
#view-regulacao .reg-empty-add svg, #view-regulacao .reg-empty-add i { width:14px; height:14px; }
#view-regulacao .reg-empty-drop { border:1.5px dashed #e0e7d4; border-radius:10px; padding:14px 8px; text-align:center; color:#8d9977; font-size:11.5px; }
/* V6 — limite WIP da coluna "Em andamento" */
#view-regulacao .reg-kanban-column.is-over-wip { border-color:#fca5a5; }
#view-regulacao .reg-kanban-column.is-over-wip > header span { background:#fdeef0 !important; color:#b91c1c !important; }
#view-regulacao .reg-wip-hint { display:flex; align-items:center; gap:5px; font-size:10.5px; font-weight:700; color:#b91c1c; background:#fdeef0; border-radius:6px; padding:4px 8px; margin-bottom:8px; }
#view-regulacao .reg-wip-hint svg, #view-regulacao .reg-wip-hint i { width:12px; height:12px; }
/* O6 — filtros rápidos */
#view-regulacao .reg-task-filters { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 12px; }
#view-regulacao .reg-task-filter-chip { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:700; padding:6px 12px; border-radius:999px; border:1px solid #e0e7d4; background:#fff; color:#4d5243; cursor:pointer; transition:background .12s, border-color .12s, color .12s; }
#view-regulacao .reg-task-filter-chip:hover { border-color:#c5d1b0; }
#view-regulacao .reg-task-filter-chip.active { background:#4a5f25; border-color:#4a5f25; color:#fff; }
#view-regulacao .reg-task-filter-chip svg, #view-regulacao .reg-task-filter-chip i { width:13px; height:13px; }
#view-regulacao .reg-task-filter-prio { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:#4d5243; }
#view-regulacao .reg-task-filter-prio svg, #view-regulacao .reg-task-filter-prio i { width:13px; height:13px; }
#view-regulacao .reg-task-filter-prio select { padding:5px 8px; border-radius:8px; border:1px solid #e0e7d4; font-size:12px; background:#fff; }
#view-regulacao .reg-task-filter-clear { display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:600; color:#b91c1c; background:none; border:none; cursor:pointer; }
#view-regulacao .reg-task-filter-clear svg, #view-regulacao .reg-task-filter-clear i { width:13px; height:13px; }
#view-regulacao .reg-task-search { flex:1 1 220px; min-width:180px; padding:7px 11px; border:1px solid #e0e7d4; border-radius:8px; font-size:12.5px; box-sizing:border-box; }
#view-regulacao .reg-task-search:focus { outline:none; border-color:#638625; box-shadow:0 0 0 3px rgba(99,134,37,.12); }
#view-regulacao .reg-agenda-histsearch { margin-bottom:12px; }
#view-regulacao .reg-agenda-histsearch input { width:100%; max-width:380px; padding:8px 11px; border:1px solid #e0e7d4; border-radius:8px; font-size:13px; box-sizing:border-box; }
#view-regulacao .reg-agenda-histsearch input:focus { outline:none; border-color:#638625; box-shadow:0 0 0 3px rgba(99,134,37,.12); }
/* O1 — arrastar e soltar */
#view-regulacao .reg-task-card-min[draggable="true"] { cursor:grab; }
#view-regulacao .reg-task-card-min.dragging { opacity:.45; cursor:grabbing; }
#view-regulacao .reg-kanban-column.drop-target { outline:2px dashed #638625; outline-offset:-4px; background:#f5faeb; }

/* ===== Painel Abertura de Agenda ===== */
#view-regulacao .reg-agenda { display:grid; gap:16px; }
#view-regulacao .reg-subtabs { display:flex; gap:8px; border-bottom:1px solid #e8eaf0; }
#view-regulacao .reg-subtab { display:inline-flex; align-items:center; gap:6px; background:none; border:none; border-bottom:3px solid transparent; padding:8px 12px; font-size:13px; font-weight:700; color:#5b6250; cursor:pointer; }
#view-regulacao .reg-subtab:hover { color:#212717; }
#view-regulacao .reg-subtab.active { color:#4a5f25; border-bottom-color:#4a5f25; }
#view-regulacao .reg-subtab svg, #view-regulacao .reg-subtab i { width:15px; height:15px; }
#view-regulacao .reg-agenda-form { background:#fff; border:1px solid #e8eaf0; border-radius:12px; padding:16px 18px; }
#view-regulacao .reg-agenda-form p.small { margin:0 0 12px; color:#5b6250; }
#view-regulacao .reg-agenda-rows-head { font-weight:800; font-size:.9rem; margin:6px 0 8px; }
#view-regulacao .reg-agenda-rows-scroll { overflow-x:auto; }
#view-regulacao .reg-agenda-rows th { font-size:11px; color:#5b6250; text-align:left; }
#view-regulacao .reg-agenda-rows td { padding:4px 6px 4px 0; vertical-align:middle; }
#view-regulacao .reg-agenda-rows input { width:100%; min-width:120px; padding:7px 8px; border:1px solid #e0e7d4; border-radius:8px; font-size:13px; box-sizing:border-box; }
#view-regulacao .reg-agenda-rows input[type="time"] { min-width:108px; }
#view-regulacao .reg-agenda-days-btn { white-space:nowrap; }
#view-regulacao .reg-agenda-days-btn.has-days { background:#ebf5db; color:#4a5f25; border-color:#c5d1b0; }
#view-regulacao .reg-agenda-addrow { margin:10px 0 4px; }
#view-regulacao .reg-agenda-list table { width:100%; }
#view-regulacao .reg-agenda-status { display:inline-flex; align-items:center; font-size:11px; font-weight:800; padding:3px 9px; border-radius:999px; background:#e0e7d4; color:#4d5243; white-space:nowrap; }
#view-regulacao .reg-agenda-status-todo { background:#e0e7d4; color:#4d5243; }
#view-regulacao .reg-agenda-status-doing { background:#eef4fd; color:#1e40af; }
#view-regulacao .reg-agenda-status-pending { background:#fef3c7; color:#92400e; }
#view-regulacao .reg-agenda-status-done { background:#eafaf0; color:#1f8a5b; }
#view-regulacao .reg-agenda-status-returned { background:#fdeef0; color:#b91c1c; }
#view-regulacao .reg-agenda-returnmsg { color:#b91c1c; margin-top:3px; }
#view-regulacao .reg-agenda-acts { white-space:nowrap; }
#view-regulacao .reg-agenda-acts .btn { margin:2px 0; }
#view-regulacao .reg-agenda-return-banner { display:flex; align-items:flex-start; gap:8px; background:#fff7ed; border:1px solid #fed7aa; color:#9a3412; border-radius:10px; padding:10px 12px; margin-bottom:12px; font-size:13px; }
#view-regulacao .reg-agenda-return-banner svg, #view-regulacao .reg-agenda-return-banner i { width:16px; height:16px; flex:0 0 auto; margin-top:2px; }
/* Relatório unificado de agendas (dashboard) */
#view-regulacao .reg-agenda-report-filters { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; margin-bottom:12px; }
#view-regulacao .reg-agenda-report-filters label { display:flex; flex-direction:column; gap:3px; font-size:12px; font-weight:700; color:#4d5243; }
#view-regulacao .reg-agenda-report-filters input, #view-regulacao .reg-agenda-report-filters select { padding:7px 9px; border:1px solid #e0e7d4; border-radius:8px; font-size:13px; }
#view-regulacao .reg-agrep-totals { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:10px; }
#view-regulacao .reg-agrep-kpi { background:#ebf5db; color:#3d4f1f; border-radius:8px; padding:6px 12px; font-size:13px; }
#view-regulacao .reg-agrep-kpi strong { font-size:1.05rem; }
#view-regulacao .reg-agrep-breakdown { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:4px 0 8px; }
#view-regulacao .reg-agrep-bl { font-size:11.5px; font-weight:700; color:#5b6250; margin-right:4px; }
#view-regulacao .reg-agrep-chip { font-size:11.5px; background:#ecf0e5; color:#4d5243; border-radius:999px; padding:3px 10px; }
#view-regulacao .reg-agrep-tablewrap { max-height:380px; overflow:auto; border:1px solid #eef1f6; border-radius:10px; }

/* ===== Construtor de formulário por subcategoria + formulário na tratativa ===== */
#view-regulacao .reg-cat-formtag { font-size:10.5px; font-weight:800; color:#0e7490; background:#cffafe; padding:2px 8px; border-radius:999px; display:inline-flex; align-items:center; gap:4px; }
#view-regulacao .reg-cat-formtag svg, #view-regulacao .reg-cat-formtag i { width:11px; height:11px; }
#reg-modal .reg-fb-head, #reg-modal .reg-tf-head, .reg-fb-head, .reg-tf-head { font-weight:800; font-size:.9rem; margin:10px 0 8px; display:flex; align-items:center; gap:6px; }
#reg-modal .reg-fb-table { width:100%; }
#reg-modal .reg-fb-table th { font-size:11px; color:#5b6250; text-align:left; padding:2px 6px 4px 0; }
#reg-modal .reg-fb-table td { padding:4px 6px 4px 0; vertical-align:middle; }
#reg-modal .reg-fb-table input, #reg-modal .reg-fb-table select { padding:6px 8px; border:1px solid #e0e7d4; border-radius:7px; font-size:12.5px; box-sizing:border-box; }
#reg-modal .reg-fb-table td:first-child input { width:100%; min-width:150px; }
.reg-fb-add { margin:8px 0; }
.reg-treat-form { background:#f7f9f4; border:1px solid #eef1f6; border-radius:12px; padding:14px 16px; margin-bottom:14px; }
.reg-tf-who { font-size:11px; font-weight:600; color:#5b6250; background:#fff; border:1px solid #e0e7d4; border-radius:999px; padding:2px 9px; margin-left:6px; }
.reg-tf-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; margin-bottom:10px; }
.reg-tf-field { display:flex; flex-direction:column; gap:4px; font-size:12px; font-weight:700; color:#4d5243; }
.reg-tf-field input { padding:8px 10px; border:1px solid #e0e7d4; border-radius:8px; font-size:13px; font-weight:400; box-sizing:border-box; }
.reg-tf-field small { font-weight:400; color:#8d9977; }
.reg-tf-link { font-size:10px; font-weight:700; color:#4a5f25; background:#ebf5db; padding:1px 6px; border-radius:999px; }

/* ===== Histórico de Abertura de Agenda — cards com linha do tempo ===== */
#view-regulacao .agc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(330px,1fr)); gap:14px; }
#view-regulacao .agc { border:1px solid #e6e9f0; border-radius:14px; background:var(--card-bg, #f7f7f7); padding:14px 16px; box-shadow:0 2px 10px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.05); border-left:4px solid #c5d1b0; transition:box-shadow .16s ease, transform .16s ease; }
#view-regulacao .agc:hover { box-shadow:0 6px 18px rgba(15,23,42,.12), 0 2px 4px rgba(15,23,42,.06); transform:translateY(-1px); }
#view-regulacao .agc-todo { border-left-color:#3a6fd0; }
#view-regulacao .agc-doing, #view-regulacao .agc-pending { border-left-color:#f59e0b; }
#view-regulacao .agc-done { border-left-color:#1f9d57; }
#view-regulacao .agc-returned { border-left-color:#e0445a; }
#view-regulacao .agc-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
#view-regulacao .agc-proto { font-weight:800; font-size:.92rem; color:#212717; display:inline-flex; align-items:center; gap:4px; }
#view-regulacao .agc-proto svg, #view-regulacao .agc-proto i { width:14px; height:14px; color:#8d9977; }
#view-regulacao .agc-badge { font-size:11px; font-weight:800; padding:3px 10px; border-radius:999px; white-space:nowrap; }
#view-regulacao .agc-badge-todo { background:#eef4fd; color:#1d4ed8; }
#view-regulacao .agc-badge-doing, #view-regulacao .agc-badge-pending { background:#fef3c7; color:#b45309; }
#view-regulacao .agc-badge-done { background:#eafaf0; color:#1f8a5b; }
#view-regulacao .agc-badge-returned { background:#fdeef0; color:#b91c1c; }
#view-regulacao .agc-steps { display:flex; align-items:center; margin:4px 0 12px; }
#view-regulacao .agc-step { display:flex; flex-direction:column; align-items:center; gap:4px; flex:0 0 auto; }
#view-regulacao .agc-dot { width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; background:#eef2f7; color:#8d9977; border:2px solid #e0e7d4; }
#view-regulacao .agc-step.done .agc-dot { background:#1f9d57; color:#fff; border-color:#1f9d57; }
#view-regulacao .agc-step.cur .agc-dot { background:#3a6fd0; color:#fff; border-color:#3a6fd0; box-shadow:0 0 0 3px #eef4fd; }
#view-regulacao .agc-step-lb { font-size:10px; font-weight:700; color:#5b6250; }
#view-regulacao .agc-step.done .agc-step-lb, #view-regulacao .agc-step.cur .agc-step-lb { color:#4d5243; }
#view-regulacao .agc-conn { flex:1 1 auto; height:3px; background:#e0e7d4; margin:0 6px 14px; border-radius:2px; min-width:18px; }
#view-regulacao .agc-conn.on { background:#1f9d57; }
#view-regulacao .agc-ret-banner { display:flex; gap:8px; align-items:flex-start; background:#fdeef0; border:1px solid #f7d3d8; color:#d6334a; border-radius:10px; padding:8px 10px; margin:2px 0 12px; font-size:12.5px; }
#view-regulacao .agc-ret-banner svg, #view-regulacao .agc-ret-banner i { width:15px; height:15px; flex:0 0 auto; margin-top:1px; }
#view-regulacao .agc-meta { display:flex; flex-direction:column; gap:5px; font-size:12.5px; color:#4d5243; margin-bottom:10px; }
#view-regulacao .agc-meta span { display:inline-flex; align-items:center; gap:6px; }
#view-regulacao .agc-meta svg, #view-regulacao .agc-meta i { width:14px; height:14px; color:#8d9977; }
#view-regulacao .agc-profs { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
#view-regulacao .agc-prof { font-size:11.5px; background:#ecf0e5; color:#4d5243; border-radius:8px; padding:4px 9px; }
#view-regulacao .agc-acts { display:flex; flex-wrap:wrap; gap:6px; border-top:1px solid #ecf0e5; padding-top:10px; }
#view-regulacao .reg-agenda-empty { display:flex; flex-direction:column; align-items:center; gap:8px; padding:40px 16px; color:#8d9977; text-align:center; }
#view-regulacao .reg-agenda-empty svg, #view-regulacao .reg-agenda-empty i { width:30px; height:30px; }
#view-regulacao .reg-subtabs { flex-wrap:wrap; gap:6px; }
#view-regulacao .reg-agenda-info { display:flex; gap:8px; align-items:flex-start; background:#eef4fd; border:1px solid #d7e4f7; color:#1e40af; border-radius:10px; padding:9px 12px; font-size:12.5px; margin-bottom:14px; }
#view-regulacao .reg-agenda-info svg, #view-regulacao .reg-agenda-info i { width:16px; height:16px; flex:0 0 auto; margin-top:1px; }
#view-regulacao .reg-agenda-policy { display:flex; gap:12px; align-items:flex-start; background:#fff7ed; border:1px solid #fed7aa; border-left:4px solid #f59e0b; border-radius:12px; padding:12px 14px; margin:14px 0 16px; }
#view-regulacao .reg-agenda-policy svg, #view-regulacao .reg-agenda-policy i { width:20px; height:20px; color:#d97706; flex:0 0 auto; margin-top:1px; }
#view-regulacao .reg-agenda-policy strong { display:block; color:#9a3412; font-size:13px; margin-bottom:2px; }
#view-regulacao .reg-agenda-policy span { color:#7c4a23; font-size:12.5px; line-height:1.5; display:block; }
/* Modal de horários das vagas */
#reg-modal .reg-agt-head { font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; font-weight:800; color:var(--text-muted,#606755); margin:16px 0 8px; }
#reg-modal .reg-agt-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(86px, 1fr)); gap:6px; margin-bottom:10px; }
#reg-modal .reg-agt-item {
  display:flex; align-items:center; gap:0; box-sizing:border-box;
  background:var(--surface,#fff); border:1px solid var(--border,#d6dacf); border-radius:7px;
  padding:1px 1px 1px 4px; transition:border-color .15s, box-shadow .15s;
}
#reg-modal .reg-agt-item:hover { border-color:var(--primary,#394820); box-shadow:0 2px 6px rgba(56,70,34,.08); }
#reg-modal .reg-agt-item:focus-within { border-color:var(--primary,#394820); box-shadow:0 0 0 2px var(--primary-glass,rgba(56,70,34,.10)); }
#reg-modal .reg-agt-item input {
  flex:1 1 auto; width:auto; min-width:56px; box-sizing:border-box; margin:0; padding:4px 2px;
  font-size:.78rem; font-weight:700; text-align:center; color:var(--text-main,#10140b);
  border:0; background:transparent; font-variant-numeric:tabular-nums; letter-spacing:0;
}
#reg-modal .reg-agt-item input:focus { outline:none; box-shadow:none; }
#reg-modal .reg-agt-del {
  flex:0 0 auto; width:16px; height:16px; padding:0; margin:0; line-height:1; border:0; border-radius:50%;
  display:grid; place-items:center; background:transparent; color:#9fa792; cursor:pointer;
  font-size:14px; font-weight:700;
}
#reg-modal .reg-agt-del:hover { background:var(--danger-muted,#fdf0f0); color:var(--danger,#c0392b); }
#view-regulacao .reg-agenda-rows-head { display:flex; align-items:center; justify-content:space-between; font-weight:800; font-size:.9rem; color:#4d5243; margin:6px 0 8px; }
#view-regulacao .reg-agenda-rows-head span { display:inline-flex; align-items:center; gap:6px; }
#view-regulacao .reg-agenda-rows-head svg, #view-regulacao .reg-agenda-rows-head i { width:15px; height:15px; }
/* Calendário de agenda (vagas + cancelamentos) */
#view-regulacao .reg-cal-legend { display:flex; align-items:center; gap:6px; font-size:12px; color:#4d5243; margin-bottom:12px; }
#view-regulacao .reg-cal-dot { display:inline-block; width:10px; height:10px; border-radius:50%; }
#view-regulacao .reg-cal-dot-vaga { background:#1f9d57; }
#view-regulacao .reg-cal-dot-canc { background:#e0445a; }
#view-regulacao .reg-cal-head { display:flex; align-items:center; justify-content:center; gap:14px; margin-bottom:10px; }
#view-regulacao .reg-cal-head strong { font-size:1rem; min-width:170px; text-align:center; }
#view-regulacao .reg-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
#view-regulacao .reg-cal-weekday { text-align:center; font-size:11px; font-weight:800; color:#8d9977; padding:4px 0; }
#view-regulacao .reg-cal-cell { min-height:62px; border:1px solid #e6e9f0; border-radius:10px; background:var(--card-bg,#f7f7f7); padding:6px; display:flex; flex-direction:column; gap:4px; }
#view-regulacao .reg-cal-cell.reg-cal-empty { background:transparent; border:0; }
#view-regulacao .reg-cal-cell.has-data { cursor:pointer; background:#fff; }
#view-regulacao .reg-cal-cell.has-data:hover { border-color:#c5d1b0; box-shadow:0 2px 8px rgba(15,23,42,.08); }
#view-regulacao .reg-cal-cell.is-today { outline:2px solid #4a5f25; outline-offset:-2px; }
#view-regulacao .reg-cal-num { font-size:12px; font-weight:700; color:#4d5243; }
#view-regulacao .reg-cal-marks { display:flex; gap:4px; flex-wrap:wrap; margin-top:auto; }
#view-regulacao .reg-cal-badge { font-size:10.5px; font-weight:800; color:#fff; border-radius:999px; padding:1px 7px; }
#view-regulacao .reg-cal-badge-vaga { background:#1f9d57; }
#view-regulacao .reg-cal-badge-canc { background:#e0445a; }
#reg-modal .reg-cal-day-sec { margin-bottom:12px; }
#reg-modal .reg-cal-day-title { font-weight:800; font-size:13px; display:flex; align-items:center; gap:6px; margin-bottom:6px; }
#reg-modal .reg-cal-item { border:1px solid #e6e9f0; border-radius:8px; padding:7px 10px; margin-bottom:6px; background:#fff; }
#reg-modal .reg-cal-item-vaga { border-left:3px solid #1f9d57; }
#reg-modal .reg-cal-item-canc { border-left:3px solid #e0445a; }
/* Cancelar vaga — chips de horário */
#view-regulacao .reg-cancel-chips { display:flex; flex-wrap:wrap; gap:8px; margin:0; }
#view-regulacao .reg-cancel-chip {
  display:inline-flex; align-items:center; gap:6px; position:relative;
  border:1.5px solid var(--border,#d6dacf); border-radius:999px; padding:7px 15px;
  font-size:.82rem; font-weight:700; cursor:pointer; user-select:none; white-space:nowrap;
  background:var(--surface-2,#f3f4f0); color:var(--text-muted,#606755); transition:all .15s;
}
#view-regulacao .reg-cancel-chip:hover { border-color:var(--primary,#394820); color:var(--primary,#394820); }
#view-regulacao .reg-cancel-chip input { position:absolute; opacity:0; width:0; height:0; margin:0; }
#view-regulacao .reg-cancel-chip:has(input:checked) { background:var(--primary,#394820); color:#fff; border-color:var(--primary-dark,#323e1d); }
#view-regulacao .reg-cancel-all-chip { border-style:dashed; }
#view-regulacao .reg-cancel-all-chip:has(input:checked) { background:var(--accent,#e6b800); color:#3a2a00; border-color:var(--accent-dark,#b8900a); border-style:solid; }
/* Nova agenda: calendário em cima + formulário embaixo */
#view-regulacao .reg-agenda-cal-block { margin-bottom:22px; padding-bottom:20px; border-bottom:1px solid #ececf2; }
#view-regulacao .reg-agenda-cal-title { display:flex; align-items:center; gap:8px; font-weight:800; font-size:.95rem; color:#252e15; margin:4px 0 12px; }
#view-regulacao .reg-agenda-cal-title svg, #view-regulacao .reg-agenda-cal-title i { width:18px; height:18px; }
/* Filtros recolhíveis (abrir/fechar) */
#view-regulacao .reg-filters-bar { margin-bottom:10px; }
#view-regulacao .reg-filters-toggle { display:inline-flex; align-items:center; gap:7px; background:var(--surface,#fff); border:1px solid var(--border); border-radius:8px; padding:8px 14px; font-size:.82rem; font-weight:800; color:#4d5243; cursor:pointer; }
#view-regulacao .reg-filters-toggle:hover { background:#f7f9f4; }
#view-regulacao .reg-filters-toggle svg, #view-regulacao .reg-filters-toggle i { width:15px; height:15px; }
#view-regulacao .reg-filters-chev { transition:transform .2s ease; }
#view-regulacao .reg-filters-toggle.open .reg-filters-chev { transform:rotate(180deg); }
#view-regulacao .reg-filter-band.is-collapsed, #view-regulacao .reg-task-filters.is-collapsed { display:none; }
/* Calendário multi-dia (modal) */
#reg-modal .reg-cal-head, #view-regulacao .reg-cal-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; }
#reg-modal .reg-cal-head strong { font-size:.95rem; }
.reg-cal-grid { display:grid; grid-template-columns:repeat(7, 1fr); gap:4px; }
.reg-cal-wd { text-align:center; font-size:11px; font-weight:700; color:#8d9977; padding:2px 0; }
.reg-cal-empty { height:36px; }
.reg-cal-day { height:36px; border:1px solid #e0e7d4; background:#fff; border-radius:8px; font-size:13px; font-weight:600; color:#212717; cursor:pointer; }
.reg-cal-day:hover { border-color:#c5d1b0; background:#f5faeb; }
.reg-cal-day.sel { background:#4a5f25; border-color:#4a5f25; color:#fff; }
.reg-cal-day.reg-cal-past, .reg-cal-day:disabled { color:#c5d1b0; background:#f7f9f4; border-color:#eef2f7; cursor:not-allowed; text-decoration:line-through; }
.reg-cal-day.reg-cal-past:hover { border-color:#eef2f7; background:#f7f9f4; }
.reg-cal-sel { margin-top:10px; color:#5b6250; font-weight:600; }
.reg-cal-selchips { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.reg-cal-selchip { display:inline-flex; align-items:center; gap:4px; background:#eef2e6; border:1px solid #d5e2bf; color:#33411a; border-radius:999px; padding:3px 6px 3px 10px; font-size:12px; font-weight:700; }
.reg-cal-selchip-x { border:none; background:#d9e5c5; color:#4a5f25; width:18px; height:18px; line-height:1; border-radius:50%; cursor:pointer; font-size:14px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; padding:0; }
.reg-cal-selchip-x:hover { background:#e0445a; color:#fff; }

/* ===== Modal tratar — campos comentário/tratativa + lista de anexos ===== */
.reg-treat-field { display:flex; flex-direction:column; gap:5px; margin-bottom:10px; }
.reg-treat-field > span { display:flex; align-items:center; gap:6px; font-size:.74rem; font-weight:800; color:#4d5243; }
.reg-treat-field > span i { width:15px; height:15px; }
.reg-treat-field-tratativa > span { color:#4a5f25; }
.reg-file-list { display:flex; flex-direction:column; gap:6px; margin:8px 0 4px; }
.reg-file-item { display:flex; align-items:center; gap:8px; padding:7px 10px; border:1px solid #e8eaf0; border-radius:8px; background:#f7f9f4; }
.reg-file-item > i { width:15px; height:15px; color:#4a5f25; flex:none; }
.reg-file-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.82rem; color:#212717; font-weight:600; }
.reg-file-size { font-size:.72rem; color:#8d9977; flex:none; }
.reg-file-remove { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; border:none; border-radius:6px; background:#fdeef0; color:#b91c1c; cursor:pointer; flex:none; }
.reg-file-remove:hover { background:#f7d3d8; }
.reg-file-remove i { width:14px; height:14px; }

/* Dica de SLA no formulário de nova tarefa */
.reg-sla-hint { display:flex; align-items:center; gap:6px; font-size:.78rem; font-weight:700; color:#4a5f25; background:#f5f3ff; border:1px solid #cae797; border-radius:8px; padding:7px 11px; margin-top:-2px; }
.reg-sla-hint i { width:15px; height:15px; }
.reg-sla-hint.reg-hidden { display:none; }

/* ===== UBS — bloco de triagem visível no atendimento médico ===== */
.ubs-triagem-card { border:1px solid #d6dfc4; background:#f5f7f2; border-radius:12px; padding:12px 14px; margin:4px 0 14px; }
.ubs-triagem-card.ubs-triagem-empty { color:#8d9977; font-size:.85rem; background:#f7f9f4; border-color:#eef0f4; }
.ubs-triagem-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
.ubs-triagem-head strong { display:flex; align-items:center; gap:7px; color:#4a5f25; font-size:.92rem; }
.ubs-triagem-head strong i, .ubs-triagem-head strong svg { width:16px; height:16px; }
.ubs-risco-badge { font-size:.72rem; font-weight:800; padding:3px 10px; border-radius:999px; white-space:nowrap; }
.ubs-triagem-queixa { margin:6px 0 10px; }
.ubs-triagem-queixa > span { display:block; font-size:.7rem; font-weight:800; color:#5b6250; text-transform:uppercase; letter-spacing:.02em; }
.ubs-triagem-queixa > p { margin:3px 0 0; color:#212717; font-size:.9rem; line-height:1.4; }
.ubs-triagem-vitais { display:grid; grid-template-columns:repeat(auto-fit,minmax(92px,1fr)); gap:8px; }
.ubs-triagem-vitais > div { background:#fff; border:1px solid #e7eae0; border-radius:9px; padding:7px 9px; text-align:center; }
.ubs-triagem-vitais > div b { display:block; font-size:1.02rem; color:#24281d; line-height:1.1; }
.ubs-triagem-vitais > div span { font-size:.66rem; color:#8d9977; font-weight:700; }
.ubs-triagem-foot { margin-top:9px; color:#8d9977; }

/* ===== Regular paciente — autocomplete (digita e filtra) ===== */
.reg-ac { position:relative; display:flex; flex-direction:column; gap:5px; }
.reg-ac-label { font-size:.74rem; font-weight:800; color:#4d5243; }
.reg-ac > input { width:100%; box-sizing:border-box; }
.reg-ac-list { position:absolute; top:100%; left:0; right:0; z-index:9999; background:#fff; border:1px solid #e0e7d4; border-radius:10px; box-shadow:0 12px 28px rgba(15,23,42,.14); max-height:240px; overflow:auto; margin-top:4px; padding:4px; }
.reg-ac-item .reg-ac-code { color:#536f23; font-weight:700; }
.reg-ac-item > span { display:block; width:100%; }
.reg-ac-list.hidden { display:none; }
.reg-ac-item { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; text-align:left; background:none; border:none; border-radius:7px; padding:8px 10px; font-size:.85rem; color:#212717; cursor:pointer; }
.reg-ac-item:hover { background:#e9ede3; }
.reg-ac-code { font-family:'SFMono-Regular',Consolas,monospace; font-size:.72rem; color:#8d9977; flex:none; }

/* ===== UBS — lista de documentos emitidos (reabrir/imprimir) ===== */
.reg-doc-list { display:flex; flex-direction:column; gap:8px; max-height:55vh; overflow:auto; margin:4px 0; }
.reg-doc-row { display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid #e8eaf0; border-radius:10px; padding:10px 12px; background:#fff; }
.reg-doc-row strong { color:#24281d; font-size:.9rem; }

/* UBS — profissional encaminhado no card */
.ubs-flow-assignee { display:flex; align-items:center; gap:5px; color:#4a5f25; font-weight:700; margin-top:3px; }
.ubs-flow-assignee i, .ubs-flow-assignee svg { width:13px; height:13px; }

/* ===== UBS — identificação do paciente + prontuário anterior no atendimento ===== */
.ubs-paciente-card { border:1px solid #eef4fd; background:#f5f9ff; border-radius:12px; padding:11px 14px; margin:4px 0 12px; }
.ubs-paciente-head { display:flex; align-items:center; gap:7px; font-weight:800; color:#1e3a8a; font-size:.95rem; margin-bottom:8px; }
.ubs-paciente-head i, .ubs-paciente-head svg { width:16px; height:16px; }
.ubs-paciente-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:6px 14px; }
.ubs-paciente-grid > div { display:flex; flex-direction:column; }
.ubs-paciente-grid .ubs-paciente-full { grid-column:1/-1; }
.ubs-paciente-grid span { font-size:.66rem; font-weight:700; color:#5b6250; text-transform:uppercase; letter-spacing:.02em; }
.ubs-paciente-grid b { font-size:.86rem; color:#212717; }
.ubs-prontuario-bar { margin:0 0 10px; }
.ubs-hist-list { display:flex; flex-direction:column; gap:8px; max-height:260px; overflow:auto; margin:0 0 12px; padding:2px; }
.ubs-hist-item { border:1px solid #e8eaf0; border-left:3px solid #4a5f25; border-radius:8px; padding:8px 11px; background:#fff; }
.ubs-hist-top { font-size:.82rem; color:#24281d; margin-bottom:3px; }
.ubs-hist-item .small { color:#4d5243; }
.reg-hidden { display:none; }

/* ===== Atendimento clínico — padronizado com o Kanban da Regulação ===== */
#view-ubs-clinical .ubs-flow-col {
  position: relative;
  background: #fafbf9;
  border: 1px solid #e6e9e1;
  border-radius: 12px;
  padding: 14px 12px 12px;
  box-shadow: none;
}
#view-ubs-clinical .ubs-flow-col::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: 12px 12px 0 0; background: #c5d1b0;
}
#view-ubs-clinical .ubs-flow-col-triagem::before { background: #f59e0b; }
#view-ubs-clinical .ubs-flow-col-medico::before  { background: #3a6fd0; }
#view-ubs-clinical .ubs-flow-col-final::before    { background: #1f9d57; }
#view-ubs-clinical .ubs-flow-col > header { border-bottom: 1px solid #eaece6; }
#view-ubs-clinical .ubs-flow-col > header strong {
  display: flex; align-items: center; gap: 7px; font-size: .92rem; font-weight: 800; color: var(--text-main, #212717);
}
#view-ubs-clinical .ubs-flow-col > header strong::before {
  content: ""; width: 9px; height: 9px; border-radius: 3px; background: #c5d1b0;
}
#view-ubs-clinical .ubs-flow-col-triagem > header strong::before { background: #f59e0b; }
#view-ubs-clinical .ubs-flow-col-medico  > header strong::before { background: #3a6fd0; }
#view-ubs-clinical .ubs-flow-col-final    > header strong::before { background: #1f9d57; }
#view-ubs-clinical .ubs-flow-col-triagem > header span { background: #fef3c7; color: #92400e; }
#view-ubs-clinical .ubs-flow-col-medico  > header span { background: #eef4fd; color: #1e40af; }
#view-ubs-clinical .ubs-flow-col-final    > header span { background: #eafaf0; color: #1f8a5b; }
/* cards no mesmo padrão (sombra + elevação no hover), preservando o acento por risco */
#view-ubs-clinical .ubs-flow-card {
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  transition: transform .12s, box-shadow .12s;
}
#view-ubs-clinical .ubs-flow-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}
/* KPIs no estilo dos cards de indicador da regulação */
#view-ubs-clinical .ubs-flow-stats div {
  background: #fff; border: 1px solid #e6e9e1; border-radius: 12px;
  box-shadow: 0 2px 6px rgba(15,23,42,.04);
}

/* ===== UBS — Painel de Atendimento (modelo igual ao da Regulação) ===== */
#view-ubs-clinical .ubs-atend-header {
  display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap;
  background: var(--card-bg, #f7f7f7); border:1px solid #e6e9e1;
  border-radius:14px; padding:12px 14px; margin-bottom:14px;
}
#view-ubs-clinical .ubs-atend-title h3 { margin:0; font-size:1.15rem; color:#fff; }
#view-ubs-clinical .ubs-atend-title .small { color:rgba(255,255,255,.85); }
#view-ubs-clinical .ubs-atend-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
#view-ubs-clinical .ubs-guiche-input { border:1px solid var(--field-border, #c7cedb); background:#fff; border-radius:9px; padding:8px 12px; font-size:.9rem; min-width:180px; margin:0; }
#view-ubs-clinical .ubs-atend-layout { display:grid; grid-template-columns:260px 1fr; gap:14px; align-items:start; }
#view-ubs-clinical .ubs-atend-side { background:#fff; border:1px solid #e6e9e1; border-radius:14px; padding:14px; display:flex; flex-direction:column; gap:10px; box-shadow:0 2px 10px rgba(15,23,42,.04); }
#view-ubs-clinical .ubs-side-consultar { width:100%; justify-content:center; }
#view-ubs-clinical .ubs-side-title { font-size:.74rem; font-weight:800; color:#5b6250; text-transform:uppercase; letter-spacing:.03em; margin-top:4px; }
#view-ubs-clinical .ubs-side-counts { border-top:1px solid #eaece6; padding-top:10px; display:flex; flex-direction:column; gap:5px; font-size:.82rem; color:#4d5243; }
#view-ubs-clinical .ubs-side-counts b { color:#323e1d; font-weight:800; }
#view-ubs-clinical .ubs-side-admin { border-top:1px solid #eaece6; padding-top:10px; display:flex; flex-direction:column; gap:6px; }
#view-ubs-clinical .ubs-side-admin .btn { justify-content:flex-start; }
#view-ubs-clinical .ubs-atend-main-head { margin:2px 0 12px; font-size:1rem; color:#24281d; }
#view-ubs-clinical .ubs-atend-main-head strong { font-weight:800; }
#view-ubs-clinical .ubs-fila-board { display:grid; grid-template-columns:repeat(auto-fit, minmax(260px,1fr)); gap:14px; }
#view-ubs-clinical .ubs-fila-col { border:1px solid #e8eaf0; border-radius:12px; background:#fff; overflow:hidden; box-shadow:0 2px 8px rgba(15,23,42,.04); }
#view-ubs-clinical .ubs-fila-col > header { display:flex; align-items:center; justify-content:space-between; padding:10px 13px; border-bottom:1px solid #eef0f4; }
#view-ubs-clinical .ubs-fila-col > header strong { font-size:.92rem; font-weight:800; }
#view-ubs-clinical .ubs-fila-col > header span { background:#eef2f7; color:#4d5243; border-radius:999px; padding:1px 10px; font-size:.78rem; font-weight:800; }
#view-ubs-clinical .ubs-fila-normal > header { background:#eef4fd; } #view-ubs-clinical .ubs-fila-normal > header strong { color:#1e40af; } #view-ubs-clinical .ubs-fila-normal > header span { background:#eef4fd; color:#1e40af; }
#view-ubs-clinical .ubs-fila-pref > header { background:#fffbeb; } #view-ubs-clinical .ubs-fila-pref > header strong { color:#92400e; } #view-ubs-clinical .ubs-fila-pref > header span { background:#fef3c7; color:#92400e; }
#view-ubs-clinical .ubs-fila-agenda > header strong { color:#4d5243; }
#view-ubs-clinical .ubs-fila-body { padding:11px; display:flex; flex-direction:column; gap:10px; min-height:60px; }
#view-ubs-clinical .ubs-fila-empty { color:#8d9977; font-size:.84rem; text-align:center; padding:14px 6px; }
@media (max-width:900px){ #view-ubs-clinical .ubs-atend-layout { grid-template-columns:1fr; } }

/* ===== Regulação — gerenciador de Procedimentos (gestor) ===== */
#view-regulacao .reg-proc-bar { display:flex; align-items:center; gap:10px; justify-content:space-between; margin-bottom:12px; flex-wrap:wrap; }
#view-regulacao .reg-proc-search { display:flex; align-items:center; gap:6px; flex:1; min-width:220px; border:1px solid #e0e7d4; border-radius:9px; padding:6px 10px; background:#fff; }
#view-regulacao .reg-proc-search i { width:15px; height:15px; color:#8d9977; }
#view-regulacao .reg-proc-search input { border:none; outline:none; flex:1; font-size:.88rem; }
#view-regulacao .reg-proc-code { font-family:'SFMono-Regular',Consolas,monospace; font-size:.8rem; font-weight:700; color:#3730a3; background:#eef2ff; padding:2px 7px; border-radius:6px; }
#view-regulacao .reg-proc-flag { display:inline-block; font-size:9.5px; font-weight:800; text-transform:uppercase; letter-spacing:.02em; padding:2px 7px; border-radius:999px; background:#e9ede3; color:#3f5121; margin:0 3px 3px 0; }
#view-regulacao .reg-proc-flags { margin-top:6px; }
#view-regulacao .reg-proc-checks { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:6px 14px; margin-top:8px; }
#view-regulacao .reg-chk { display:flex; align-items:center; gap:7px; font-size:.85rem; color:#4d5243; font-weight:600; }
#view-regulacao .reg-chk input { width:16px; height:16px; }

/* Seletor de unidades (executar/visualizar) — procedimentos e laboratório */
#reg-modal .reg-unit-picker { margin:12px 0; border:1px solid #e0e7d4; border-radius:10px; padding:10px 12px; background:#f7f9f4; }
#reg-modal .reg-unit-head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:6px; }
#reg-modal .reg-unit-count { color:#536f23; font-weight:700; white-space:nowrap; }
#reg-modal .reg-unit-tools { display:flex; gap:6px; align-items:center; margin-bottom:8px; }
#reg-modal .reg-unit-search { flex:1; min-width:0; }
#reg-modal .reg-unit-list { max-height:210px; overflow-y:auto; display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:1px 14px; border-top:1px solid #e0e7d4; padding-top:8px; }
#reg-modal .reg-unit-item { display:flex; align-items:center; gap:7px; font-size:.84rem; color:#4d5243; font-weight:500; padding:4px 5px; border-radius:6px; cursor:pointer; }
#reg-modal .reg-unit-item:hover { background:#eef2ff; }
#reg-modal .reg-unit-item input { width:16px; height:16px; margin:0; flex:0 0 auto; }
#reg-modal .reg-unit-hint { color:#8d9977; margin-top:8px; }
/* Badge nas tabelas (autossuficiente — funciona dentro e fora de #view-regulacao) */
.reg-unit-some, .reg-unit-all { display:inline-block; font-size:9.5px; font-weight:800; text-transform:uppercase; letter-spacing:.02em; padding:2px 7px; border-radius:999px; margin:0 3px 3px 0; }
.reg-unit-some { background:#ede9fe; color:#4a5f25; }
.reg-unit-all { background:#e0e7d4; color:#4d5243; }

/* ============================================================
 * Modais responsivos — desktop mais largo / mobile compacto (2026-06-03)
 * O bloco "Polish modais globais" usa .modal-overlay .modal-box (0,2,0)
 * com !important, entao as regras mobile precisam da MESMA especificidade
 * + !important + vir depois na cascata para realmente compactar no celular.
 * Larguras: o padrao .modal-box e pequeno (520px, para dialogos/confirmacao);
 * apenas modais de FORMULARIO e CONSULTA sobem para 920px no desktop (ver bloco
 * ":has()" abaixo). Modais com largura propria (classe) continuam com a deles.
 * ============================================================ */

/* Tablet / celular grande: cabe mais conteudo, menos respiro */
@media (max-width: 860px) {
  .modal-overlay { padding: 12px !important; }
  .modal-overlay .modal-box {
    padding: 18px 18px 16px !important;
    border-radius: 14px !important;
  }
  .modal-overlay .modal-box h3 {
    font-size: 1.08rem !important;
    margin-bottom: 8px !important;
  }
  .modal-overlay .modal-box .flex,
  .modal-overlay .modal-box .modal-actions { margin-top: 16px !important; }
}

/* Celular: layout enxuto */
@media (max-width: 560px) {
  .modal-overlay { padding: 8px !important; }
  .modal-overlay .modal-box {
    padding: 14px 14px 12px !important;
    border-radius: 12px !important;
  }
  .modal-overlay .modal-box h3 { font-size: 1rem !important; margin-bottom: 6px !important; }
  .modal-overlay .modal-box p,
  .modal-overlay .modal-box .small { font-size: 0.82rem !important; }
  .modal-overlay .modal-box .flex,
  .modal-overlay .modal-box .modal-actions { margin-top: 14px !important; gap: 8px !important; }
}

/* ============================================================
 * Modais de FORMULARIO e CONSULTA mais largos no desktop (920px).
 * Detecta o conteudo com :has() — diálogos/confirmacao (sem form) ficam
 * no padrao pequeno (520px). So vale em telas grandes (>=861px); no mobile
 * os blocos compactos acima cuidam do layout.
 * Modais de classe propria (clinico 1180, etc.) mantem a largura deles
 * porque usam regra !important com ID.
 * ============================================================ */
@media (min-width: 861px) {
  .modal-box:has(form),
  .modal-box:has(.reg-form),
  .modal-box:has(.reg-form-grid),
  .modal-box:has(.prontuario-fields),
  .modal-box:has(.fat-form-grid),
  .modal-box:has(.reg-detail-grid),
  .modal-box:has(.reg-detail-wide),
  .modal-box:has(.sigtap-table-wrap),
  .modal-box:has(.sigtap-result-head),
  .modal-box:has(.ubs-paciente-grid) {
    max-width: 920px;
  }
  /* No modulo de regulacao os modais sao #reg-modal .modal-box (780 !important).
     Formulario/consulta sobem para 920; a confirmacao volta a ser estreita. */
  #reg-modal .modal-box:has(form),
  #reg-modal .modal-box:has(.reg-detail-grid),
  #reg-modal .modal-box:has(.sigtap-table-wrap) {
    max-width: 920px !important;
  }
  #reg-modal .modal-box:has(.reg-confirm-modal) {
    max-width: 440px !important;
  }
}

/* ===== Banner "RUMO AO HEXA" no splash de login (Copa) ===== */
#login-splash .hexa-banner {
  margin: 12px auto 4px;
  font-weight: 900;
  font-size: clamp(18px, 3vw, 30px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #009739 0%, #FFDF00 45%, #FFDF00 55%, #009739 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.15));
  animation: hexaPulse 1.1s ease-in-out infinite;
}
@keyframes hexaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  #login-splash .hexa-banner { animation: none; }
}
/* Confete da tela de login: confinado ao painel roxo e ATRAS do conteudo */
#view-login .login-left-panel { position: relative; overflow: hidden; }
#view-login .login-left-panel > canvas.fest-rain { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#view-login .login-left-panel .login-brand-area { position: relative; z-index: 1; }

/* Card do Kanban: campo de anexos (clipe + contagem real de task.attachments) no rodape, ao lado da data. */
#view-regulacao .reg-task-card-min .reg-task-min-right { display:inline-flex; align-items:center; gap:9px; }
#view-regulacao .reg-task-min-att { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; color:#a6ad99; }
#view-regulacao .reg-task-min-att.has { color:#4a5f25; }
#view-regulacao .reg-task-min-att svg, #view-regulacao .reg-task-min-att i { width:12px; height:12px; }

/* Anexos na Lista (celula da tarefa) e no card Transferidas. */
#view-regulacao .reg-tasklist-att { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; color:#a6ad99; margin-left:8px; }
#view-regulacao .reg-tasklist-att.has { color:#4a5f25; }
#view-regulacao .reg-tasklist-att svg, #view-regulacao .reg-tasklist-att i { width:12px; height:12px; }
#view-regulacao .reg-task-transferred-dest { display:flex; align-items:center; gap:5px; }
#view-regulacao .reg-task-transferred-dest .reg-task-min-att { margin-left:auto; }
