
/* APPT21 report/process layout */
.reports-page-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;flex-wrap:wrap!important;margin:0 0 8px!important}
.reports-page-head h1{margin:0!important;font-size:22px!important;line-height:1.1!important}
.reports-toolbar{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:nowrap!important;font-size:11px!important}
.reports-toolbar label{margin:0!important;font-size:11px!important;white-space:nowrap!important}
.reports-year-filter{width:110px!important;min-width:110px!important;max-width:110px!important;height:30px!important;min-height:30px!important;padding:3px 6px!important;margin:0!important;font-size:11px!important}
.reports-chip{display:inline-flex!important;align-items:center!important;gap:4px!important;height:30px!important;padding:3px 8px!important;border:1px solid var(--line,#dfe6e2)!important;border-radius:8px!important;background:#fff!important;font-size:11px!important;white-space:nowrap!important}
.reports-chip strong{font-size:11px!important;font-weight:800!important}
.reports-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;margin-top:0!important;align-items:start!important}
.report-card{padding:9px 10px!important;min-width:0!important;min-height:0!important;height:176px!important;max-height:176px!important;overflow:hidden!important;font-size:11px!important}
.report-card h2{margin:0 0 5px!important;font-size:11px!important;line-height:1.15!important;font-weight:700!important}
.report-card:has(.report-chart-wrap){height:245px!important;max-height:245px!important}
.report-chart-wrap{width:100%!important;height:207px!important;max-height:207px!important;overflow:auto!important;padding:0!important;margin:0!important}
.report-chart-svg{display:block!important;width:100%!important;min-width:300px!important;max-width:none!important;height:auto!important;max-height:none!important}
.report-chart-svg text{font-size:11px!important}
.report-donut-wrap{display:grid!important;grid-template-columns:128px minmax(0,1fr)!important;gap:8px!important;align-items:center!important;min-height:130px!important;max-height:130px!important;overflow:visible!important}
.report-donut{display:block!important;width:124px!important;min-width:124px!important;max-width:124px!important;height:100px!important;min-height:100px!important;max-height:100px!important;margin:0 auto!important;overflow:visible!important}
.report-donut text{font-size:8.6px!important}
.report-legend{display:grid!important;gap:4px!important;max-height:122px!important;overflow:auto!important;padding-right:2px!important}
.report-legend-row{display:grid!important;grid-template-columns:8px minmax(0,1fr) auto!important;gap:5px!important;align-items:center!important;font-size:11px!important;line-height:1.15!important}
.report-legend-dot{width:8px!important;height:8px!important;border-radius:50%!important}
.report-legend-label{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.report-legend-value{font-size:11px!important;font-weight:800!important}
.report-empty{display:grid!important;place-items:center!important;height:125px!important;font-size:11px!important}

.process-filterbar{margin:0 0 8px!important;padding:6px 8px!important}
.process-filter-main{display:flex!important;gap:5px!important;align-items:center!important;flex-wrap:wrap!important}
.process-filter-main input,.process-filter-main select{height:29px!important;min-height:29px!important;padding:3px 6px!important;margin:0!important;font-size:11.5px!important;border-radius:7px!important}
.process-filter-search{width:210px!important;min-width:170px!important;max-width:230px!important;flex:0 1 230px!important}
.process-entry-date-filter{display:inline-flex!important;align-items:center!important;gap:3px!important;flex:0 0 auto!important;width:auto!important}
.process-filter-date{width:132px!important;min-width:132px!important;max-width:132px!important;flex:0 0 132px!important}
.process-date-clear{width:29px!important;min-width:29px!important;max-width:29px!important;height:29px!important;min-height:29px!important;padding:0!important;display:inline-grid!important;place-items:center!important;font-size:16px!important;line-height:1!important;border-radius:7px!important}
.process-filter-select{width:auto!important;min-width:92px!important;max-width:155px!important}
.process-filter-clear{height:29px!important;min-height:29px!important;padding:3px 8px!important;font-size:11.5px!important}
.process-result-count{margin-left:auto!important;font-size:11px!important;white-space:nowrap!important}

/* Zona de marca: manter o logótipo oficial existente, sem o grande cartão branco */
.sidebar .official-brand{display:flex!important;align-items:center!important;justify-content:center!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:6px 8px 12px!important;margin:0 0 10px!important;border-bottom:1px solid rgba(255,255,255,.14)!important}
.sidebar .official-brand img{display:block!important;width:148px!important;max-width:88%!important;height:auto!important;margin:0!important;padding:7px 9px!important;background:#fff!important;border-radius:9px!important;box-shadow:0 3px 12px rgba(0,0,0,.10)!important}
.sidebar .official-brand small{display:none!important}
.sidebar .brand{margin:0 0 10px!important}

@media(max-width:1100px){.reports-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:700px){.reports-grid{grid-template-columns:1fr!important}.report-card{height:170px!important;max-height:170px!important}.report-card:has(.report-chart-wrap){height:240px!important;max-height:240px!important}.report-chart-wrap{height:202px!important;max-height:202px!important}.reports-toolbar{flex-wrap:wrap!important}.reports-year-filter{width:100px!important;min-width:100px!important;max-width:100px!important}}


/* Dashboard charts - layout refinement */
.reports-grid{gap:12px!important;align-items:stretch!important}
.report-card{height:198px!important;max-height:198px!important;padding:10px 12px!important}
.report-card h2{margin:0 0 7px!important;font-size:12px!important}
.report-card:has(.report-chart-wrap){height:258px!important;max-height:258px!important}
.report-chart-wrap{height:218px!important;max-height:218px!important}
.report-donut-wrap{
  grid-template-columns:138px minmax(0,1fr)!important;
  gap:10px!important;
  min-height:150px!important;
  max-height:150px!important;
}
.report-donut{
  width:132px!important;
  min-width:132px!important;
  max-width:132px!important;
  height:112px!important;
  min-height:112px!important;
  max-height:112px!important;
}
.report-donut text{font-size:8.6px!important}
.report-donut .report-donut-pct{font-size:9.9px!important}
.report-donut .report-donut-center-label{font-size:8px!important}
.report-donut .report-donut-center-value{font-size:14px!important}
.report-legend{gap:5px!important;max-height:140px!important}
.report-legend-row{font-size:11.5px!important;line-height:1.2!important}
.report-legend-value{font-size:11.5px!important;font-weight:800!important}
@media (max-width:1100px){
  .reports-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:720px){
  .reports-grid{grid-template-columns:1fr!important}
  .report-card{height:auto!important;max-height:none!important;min-height:198px!important}
  .report-card:has(.report-chart-wrap){height:auto!important;max-height:none!important}
  .report-donut-wrap{grid-template-columns:132px minmax(0,1fr)!important}
}


/* Dashboard: larger donut values + bar charts aligned on one row */
.report-donut .report-donut-pct{
  font-size:11.3px!important; /* approximately +2pt from the original size */
}
.report-bar-first{
  grid-column:1!important;
}
.report-bar-card{
  min-width:0!important;
}
@media (max-width:1100px){
  .report-bar-first{grid-column:auto!important}
}


/* Donut legend colours — classes avoid CSP-blocked inline styles */
.report-legend-row .report-legend-label,
.report-legend-row .report-legend-value{font-weight:700!important}
.legend-color-0 .report-legend-dot{background:#245c67!important}.legend-color-0 .report-legend-label,.legend-color-0 .report-legend-value{color:#245c67!important}
.legend-color-1 .report-legend-dot{background:#d18f32!important}.legend-color-1 .report-legend-label,.legend-color-1 .report-legend-value{color:#d18f32!important}
.legend-color-2 .report-legend-dot{background:#6d8b4b!important}.legend-color-2 .report-legend-label,.legend-color-2 .report-legend-value{color:#6d8b4b!important}
.legend-color-3 .report-legend-dot{background:#8b4f70!important}.legend-color-3 .report-legend-label,.legend-color-3 .report-legend-value{color:#8b4f70!important}
.legend-color-4 .report-legend-dot{background:#4973a6!important}.legend-color-4 .report-legend-label,.legend-color-4 .report-legend-value{color:#4973a6!important}
.legend-color-5 .report-legend-dot{background:#b85c4b!important}.legend-color-5 .report-legend-label,.legend-color-5 .report-legend-value{color:#b85c4b!important}
.legend-color-6 .report-legend-dot{background:#6a6d77!important}.legend-color-6 .report-legend-label,.legend-color-6 .report-legend-value{color:#6a6d77!important}
.legend-color-7 .report-legend-dot{background:#4e8876!important}.legend-color-7 .report-legend-label,.legend-color-7 .report-legend-value{color:#4e8876!important}
.legend-color-8 .report-legend-dot{background:#a56b2b!important}.legend-color-8 .report-legend-label,.legend-color-8 .report-legend-value{color:#a56b2b!important}
.legend-color-9 .report-legend-dot{background:#5c5aa3!important}.legend-color-9 .report-legend-label,.legend-color-9 .report-legend-value{color:#5c5aa3!important}
.legend-color-10 .report-legend-dot{background:#9b6f59!important}.legend-color-10 .report-legend-label,.legend-color-10 .report-legend-value{color:#9b6f59!important}
.legend-color-11 .report-legend-dot{background:#3e7e94!important}.legend-color-11 .report-legend-label,.legend-color-11 .report-legend-value{color:#3e7e94!important}
.process-filterbar-loading{opacity:.8}


/* Compact icon actions */
.icon-action{
  width:36px!important;
  min-width:36px!important;
  max-width:36px!important;
  height:36px!important;
  min-height:36px!important;
  padding:0!important;
  display:inline-grid!important;
  place-items:center!important;
  border-radius:10px!important;
  font-size:19px!important;
  line-height:1!important;
  font-weight:800!important;
  box-shadow:0 1px 2px rgba(24,54,43,.08)!important;
  position:relative!important;
}
.icon-action:hover{
  transform:translateY(-1px);
  box-shadow:0 3px 8px rgba(24,54,43,.14)!important;
}
.icon-action:active{transform:translateY(0)}
.icon-action-primary{font-size:23px!important}
.icon-action-danger{font-size:16px!important}
#bulkDeleteSelected[data-count]:not([data-count=""])::after{
  content:attr(data-count);
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:17px;
  height:17px;
  padding:0 4px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:#fff;
  color:#8c2f2f;
  border:1px solid #d8b9b9;
  font-size:9px;
  font-weight:800;
}
.process-filter-clear.icon-action{
  width:29px!important;
  min-width:29px!important;
  max-width:29px!important;
  height:29px!important;
  min-height:29px!important;
  font-size:16px!important;
  border-radius:7px!important;
}


/* Configurações — compact, readable management cards */
.cfg-head{margin-bottom:16px!important}
.cfg-head h1{margin-bottom:4px!important}
.cfg-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:12px!important;
  align-items:stretch!important;
}
.cfg-card{
  width:100%!important;
  min-height:104px!important;
  padding:16px!important;
  border:1px solid #dbe3d4!important;
  border-radius:14px!important;
  background:#fff!important;
  color:#203329!important;
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr) auto 16px!important;
  grid-template-areas:"icon copy count arrow"!important;
  gap:12px!important;
  align-items:center!important;
  text-align:left!important;
  cursor:pointer!important;
  box-shadow:0 4px 14px rgba(39,66,48,.045)!important;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background .16s ease!important;
}
.cfg-card:hover{
  transform:translateY(-2px)!important;
  border-color:#b8c9a8!important;
  background:#fbfdf8!important;
  box-shadow:0 8px 22px rgba(39,66,48,.09)!important;
}
.cfg-card:focus-visible{
  outline:3px solid rgba(91,128,73,.2)!important;
  outline-offset:2px!important;
}
.cfg-icon{
  grid-area:icon!important;
  width:42px!important;
  height:42px!important;
  border-radius:11px!important;
  display:grid!important;
  place-items:center!important;
  background:#eef4e8!important;
  color:#40622f!important;
  font-size:21px!important;
  font-weight:800!important;
  line-height:1!important;
}
.cfg-copy{grid-area:copy!important;min-width:0!important;display:block!important}
.cfg-title{
  display:block!important;
  margin:0 0 5px!important;
  font-size:14px!important;
  line-height:1.15!important;
  font-weight:800!important;
  color:#17251d!important;
}
.cfg-subtitle{
  display:block!important;
  color:#66766c!important;
  font-size:11.5px!important;
  line-height:1.35!important;
}
.cfg-count{
  grid-area:count!important;
  align-self:center!important;
  white-space:nowrap!important;
  padding:5px 8px!important;
  border:1px solid #d6e0cd!important;
  border-radius:999px!important;
  background:#f0f5ea!important;
  color:#48622f!important;
  font-size:10.5px!important;
  font-weight:800!important;
}
.cfg-arrow{
  grid-area:arrow!important;
  color:#8b9a90!important;
  font-size:22px!important;
  line-height:1!important;
}
.cfg-note{
  margin-top:16px!important;
  border-radius:10px!important;
  font-size:11.5px!important;
}
@media(max-width:1200px){
  .cfg-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:720px){
  .cfg-grid{grid-template-columns:1fr!important}
  .cfg-card{
    grid-template-columns:38px minmax(0,1fr) 14px!important;
    grid-template-areas:"icon copy arrow" "icon count arrow"!important;
  }
  .cfg-count{justify-self:start!important}
}

/* Configurações — playful visual identity */
.cfg-card{overflow:hidden!important;position:relative!important}
.cfg-card::before{content:"";position:absolute;width:84px;height:84px;right:-28px;top:-30px;border-radius:50%;background:rgba(92,126,72,.06);pointer-events:none}
.cfg-icon{font-size:23px!important;background:#f4f7f0!important;box-shadow:inset 0 0 0 1px rgba(63,93,48,.08)!important;transition:transform .16s ease,background .16s ease!important}
.cfg-card:hover .cfg-icon{transform:rotate(-5deg) scale(1.08)!important}
.cfg-card:hover .cfg-arrow{transform:translateX(3px)!important}
.cfg-arrow{transition:transform .16s ease!important;font-weight:800!important}
.cfg-professionals .cfg-icon{background:#eaf4ff!important}
.cfg-establishments .cfg-icon{background:#fff2df!important}
.cfg-context_options .cfg-icon{background:#ecf7ef!important}
.cfg-eligibility_options .cfg-icon{background:#eef8e9!important}
.cfg-status_options .cfg-icon{background:#fff0ec!important}
.cfg-periodicity_options .cfg-icon{background:#f0edff!important}
.cfg-health_services .cfg-icon{background:#eaf7f6!important}
.cfg-referral_entity_options .cfg-icon{background:#fff7e6!important}
.cfg-app_users .cfg-icon{background:#f3f0ff!important}

/* Professional line icons for process actions */
.icon-action svg{
  width:19px!important;
  height:19px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  pointer-events:none!important;
}
.icon-action-primary svg{width:21px!important;height:21px!important;stroke-width:2!important}
.icon-action-danger svg{width:18px!important;height:18px!important}
.icon-spinner{font-size:16px!important;line-height:1!important}

/* Registos: alterações + acessos */
.records-head{margin-bottom:10px!important}
.records-tabs{
  display:flex!important;gap:6px!important;margin:0 0 12px!important;padding:4px!important;
  width:max-content!important;max-width:100%!important;border:1px solid #d8e2d1!important;
  border-radius:11px!important;background:#f4f7f0!important
}
.records-tab{
  border:0!important;border-radius:8px!important;padding:7px 13px!important;background:transparent!important;
  color:#56645b!important;font-size:12px!important;font-weight:800!important;cursor:pointer!important
}
.records-tab:hover{background:#eaf1e4!important;color:#365226!important}
.records-tab.active{background:#fff!important;color:#365f21!important;box-shadow:0 1px 5px rgba(45,74,51,.12)!important}
#recordsContent>.head{margin-top:0!important}

/* Dashboard donut charts — keep chart and legend clearly separated */
.report-donut-wrap{
  display:grid!important;
  grid-template-columns:160px minmax(0,1fr)!important;
  column-gap:18px!important;
  align-items:center!important;
  min-height:150px!important;
  max-height:150px!important;
  overflow:visible!important;
}
.report-donut{
  width:150px!important;
  min-width:150px!important;
  max-width:150px!important;
  height:108px!important;
  min-height:108px!important;
  max-height:108px!important;
  margin:0!important;
  justify-self:start!important;
  overflow:visible!important;
}
.report-legend{
  width:100%!important;
  max-height:142px!important;
  overflow:auto!important;
  padding:0 4px 0 0!important;
  margin:0!important;
  align-self:center!important;
}
.report-legend-row{
  grid-template-columns:9px minmax(0,1fr) 44px!important;
  gap:7px!important;
  width:100%!important;
}
.report-legend-value{
  justify-self:end!important;
  text-align:right!important;
  min-width:40px!important;
}
@media(max-width:720px){
  .report-donut-wrap{
    grid-template-columns:150px minmax(0,1fr)!important;
    column-gap:12px!important;
  }
}

/* Process status history */
.status-history-section{margin-top:16px!important;padding-top:14px!important;border-top:1px solid #e1e7dd!important}
.status-history-section h3{margin:0 0 9px!important;font-size:13px!important}
.status-history-wrap{overflow:auto!important;border:1px solid #e2e8df!important;border-radius:10px!important}
.status-history-table{margin:0!important;min-width:620px!important}
.status-history-table th{font-size:10.5px!important;color:#607067!important;background:#f7f9f5!important}
.status-history-table td{font-size:11.5px!important;vertical-align:top!important}
.status-history-table td:nth-child(2),
.status-history-table td:nth-child(3){white-space:nowrap!important;width:110px!important}

/* Editable status history in process detail */
.status-history-detail-table .status-history-actions{width:82px!important;text-align:center!important;white-space:nowrap!important}
.status-history-edit,.status-history-save,.status-history-cancel{
  min-width:30px!important;width:30px!important;height:30px!important;padding:0!important;
  border-radius:8px!important;display:inline-grid!important;place-items:center!important;
  font-size:15px!important;line-height:1!important
}
.status-history-save{margin-right:4px!important}
.status-history-detail-table select,
.status-history-detail-table input[type="date"],
.status-history-detail-table textarea{
  width:100%!important;min-width:120px!important;padding:7px 8px!important;
  border:1px solid #ccd8c8!important;border-radius:8px!important;background:#fff!important;font:inherit!important
}
.status-history-detail-table textarea{min-width:180px!important;min-height:54px!important;resize:vertical!important}

/* ELI Lisboa Norte visible branding */
.eli-sidebar-brand{
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
  min-height:76px!important;margin:0 0 12px!important;padding:14px 12px!important;border-radius:12px!important;
  background:#fff!important;color:#244c3d!important;text-align:center!important;box-shadow:0 2px 10px rgba(0,0,0,.05)!important
}
.eli-sidebar-brand strong{font-size:18px!important;line-height:1.15!important}
.eli-sidebar-brand small{margin-top:5px!important;font-size:10.5px!important;color:#748078!important;font-weight:700!important}
.eli-auth-brand{
  margin:0 auto 18px!important;padding:12px 16px!important;border-radius:12px!important;background:#f4f7f0!important;
  color:#315d45!important;font-size:20px!important;font-weight:850!important;text-align:center!important
}
.eli-mobile-brand{font-weight:850!important;color:#244c3d!important}

/* Sortable process list headers */
.process-sort-th{padding:0!important}
.process-sort-btn{
  width:100%!important;
  min-height:38px!important;
  padding:9px 8px!important;
  border:0!important;
  background:transparent!important;
  color:inherit!important;
  font:inherit!important;
  font-weight:800!important;
  text-align:left!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:6px!important;
  cursor:pointer!important;
  border-radius:7px!important;
}
.process-sort-btn:hover{background:#eef4e9!important;color:#365d28!important}
.process-sort-btn.active{color:#365d28!important;background:#f4f7f0!important}
.process-sort-indicator{
  flex:0 0 auto!important;
  font-size:9px!important;
  line-height:1!important;
  color:#8b9a90!important;
}
.process-sort-btn.active .process-sort-indicator{color:#4f752f!important}

.auth-actions{display:flex!important;gap:8px!important;flex-wrap:wrap!important;margin-top:10px!important}.auth-actions .btn{flex:1 1 180px!important}


/* Modal de edição de profissionais */
.eli-edit-overlay{position:fixed;inset:0;z-index:9999;background:rgba(12,34,24,.48);display:flex;align-items:center;justify-content:center;padding:18px}
.eli-edit-panel{background:#fff;color:#263c32;border-radius:16px;width:min(100%,510px);padding:24px;box-shadow:0 20px 60px rgba(0,0,0,.2)}
.eli-edit-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}
.eli-edit-head h2{margin:0}
.eli-edit-panel .field{margin-bottom:16px}
.eli-edit-panel .field input,.eli-edit-panel .field select{width:100%;min-height:42px;padding:9px 12px;border:1px solid #d2ded7;border-radius:9px;background:white;color:#233b2e}
.eli-edit-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}
#eliEditMsg{color:#a32a2a;font-size:13px}
