/* Gestão dinâmica de ASO */
.aso-native-hidden{display:none!important}
.aso-module{display:block;width:100%}
.aso-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.aso-page-head .eyebrow{display:block;color:#315c4b;font-size:11px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;margin-bottom:6px}
.aso-page-head h1{font-size:30px;line-height:1.1;margin:0;color:#10281f;letter-spacing:-.02em}
.aso-page-head p{margin:8px 0 0;color:#65736d;max-width:780px;font-size:14px}
.aso-actions-head{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.aso-btn{border:0;border-radius:10px;padding:10px 14px;font-weight:900;font-size:12px;cursor:pointer;letter-spacing:.02em;transition:.16s ease}
.aso-btn.primary{background:#315c4b;color:#fff;box-shadow:0 10px 24px rgba(49,92,75,.2)}
.aso-btn.primary:hover{background:#234639}
.aso-btn.secondary{background:#fff;border:1px solid #d8e4de;color:#315c4b}
.aso-btn.secondary:hover{background:#f3f8f5}
.aso-btn.danger{background:#fff;border:1px solid #f0c1c1;color:#a32f2f}
.aso-btn.danger:hover{background:#fdecec}
.aso-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:0 0 14px}
.aso-kpis article{background:#fff;border:1px solid #dfe9e3;border-radius:16px;padding:15px 16px;box-shadow:0 8px 20px rgba(15,23,42,.04)}
.aso-kpis article span{display:block;color:#6b7a73;font-size:11px;font-weight:900;letter-spacing:.06em;text-transform:uppercase}
.aso-kpis article strong{display:block;font-size:28px;line-height:1.1;margin:6px 0 3px;color:#18372b}
.aso-kpis article small{display:block;color:#7d8a84;font-size:11px}
.aso-kpis article.ok strong{color:#276446}.aso-kpis article.warning strong{color:#8a5a00}.aso-kpis article.danger strong{color:#a83232}.aso-kpis article.missing strong{color:#6b7280}
.aso-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px;padding:12px;background:#f8fbf9;border:1px solid #dfe9e3;border-radius:16px}
.aso-search{flex:1 1 320px}.aso-search input{width:100%;height:40px;border:1px solid #d8e4de;border-radius:10px;background:#fff;padding:0 12px;color:#24352e;outline:none}.aso-search input:focus{border-color:#6fa98e;box-shadow:0 0 0 3px rgba(49,92,75,.12)}
.aso-filters{display:flex;gap:6px;flex-wrap:wrap}.aso-filters button{border:1px solid #d8e4de;background:#fff;color:#315c4b;border-radius:999px;padding:7px 10px;font-size:11px;font-weight:900;cursor:pointer}.aso-filters button.active{background:#315c4b;color:#fff;border-color:#315c4b}
.aso-check{display:flex;align-items:center;gap:6px;color:#52615a;font-size:12px;font-weight:800;white-space:nowrap}
.aso-table-card{background:#fff;border:1px solid #dfe9e3;border-radius:16px;box-shadow:0 10px 28px rgba(15,23,42,.05);overflow:hidden}
.aso-table-wrap{width:100%;overflow:auto;max-height:calc(100vh - 320px)}
.aso-table-wrap.history{max-height:60vh}.aso-table{width:100%;border-collapse:collapse;font-size:12px;min-width:1080px}.aso-table th,.aso-table td{border-bottom:1px solid #edf2ef;padding:11px 12px;text-align:left;vertical-align:middle}.aso-table th{position:sticky;top:0;z-index:2;background:#f8fbf9;color:#607069;font-size:10px;text-transform:uppercase;letter-spacing:.08em}.aso-table td strong{display:block;color:#20342c}.aso-table td span{display:block;color:#6e7a75;font-size:11px;margin-top:2px}.aso-table tbody tr:hover td{background:#fbfdfc}.aso-sort{cursor:pointer;user-select:none}.aso-sort span{color:#9aa9a2;margin-left:3px}.aso-sort.active{color:#315c4b}.aso-danger-text{color:#a83232!important;font-weight:900}.aso-row-actions{white-space:nowrap;text-align:right}.aso-row-actions button,.aso-table [data-history-edit]{display:inline-flex;align-items:center;justify-content:center;border:1px solid #d8e4de;background:#fff;color:#315c4b;border-radius:999px;margin:2px 2px;padding:6px 9px;font-size:10px;font-weight:900;text-transform:uppercase;cursor:pointer}.aso-row-actions button:hover,.aso-table [data-history-edit]:hover{background:#eef7f2}
.aso-pill{display:inline-flex!important;align-items:center;justify-content:center;min-width:84px;border-radius:999px;padding:5px 9px!important;font-size:10px!important;font-weight:900;text-transform:uppercase;letter-spacing:.04em;margin:0!important}.aso-pill.ok{background:#e8f5ee;color:#276446;border:1px solid #b8d9c8}.aso-pill.warning{background:#fff4dd;color:#8a5a00;border:1px solid #ebd09c}.aso-pill.danger{background:#fdeaea;color:#a83232;border:1px solid #efb3b3}.aso-pill.missing{background:#eef1f4;color:#5a6470;border:1px solid #d3d9df}.aso-pill.inactive{background:#f4efe6;color:#77521a;border:1px solid #dec79f}.aso-pill.neutral{background:#eef1f4;color:#5a6470;border:1px solid #d3d9df}
.aso-empty{padding:34px;text-align:center;color:#68776f}.aso-empty strong{display:block;color:#23372f;font-size:16px;margin-bottom:4px}.aso-loading{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #dfe9e3;border-radius:16px;padding:24px;color:#315c4b;font-weight:900}.aso-notice{border-radius:12px;margin:0 0 12px;padding:12px 14px;font-size:13px;font-weight:800}.aso-notice.success{background:#e8f5ee;color:#276446;border:1px solid #b8d9c8}.aso-notice.error{background:#fdeaea;color:#a83232;border:1px solid #efb3b3}
.aso-modal-backdrop{position:fixed;inset:0;z-index:2147483000;background:rgba(15,23,42,.42);display:flex;align-items:flex-start;justify-content:center;padding:28px 16px;overflow:auto}.aso-modal{width:min(860px,100%);background:#fff;border-radius:18px;box-shadow:0 28px 80px rgba(15,23,42,.32);overflow:hidden}.aso-modal-wide{width:min(1040px,100%)}.aso-modal header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:20px 22px;border-bottom:1px solid #e7eee9}.aso-modal h2{margin:0;color:#18372b;font-size:21px}.aso-modal header p{margin:5px 0 0;color:#68776f;font-size:13px}.aso-icon{width:34px;height:34px;border-radius:999px;border:1px solid #d8e4de;background:#fff;color:#52615a;font-size:22px;line-height:1;cursor:pointer}.aso-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;padding:20px 22px 8px}.aso-form-grid label,.aso-exams-list label{display:flex;flex-direction:column;gap:6px}.aso-form-grid label.span-2{grid-column:span 2}.aso-form-grid span,.aso-exams-block h3{font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:#5f6e67}.aso-form-grid input,.aso-form-grid select,.aso-form-grid textarea{width:100%;box-sizing:border-box;border:1px solid #d8e4de;border-radius:10px;background:#fff;padding:10px 11px;color:#24352e;font-size:13px;outline:none}.aso-form-grid textarea{resize:vertical}.aso-form-grid input:focus,.aso-form-grid select:focus,.aso-form-grid textarea:focus{border-color:#6fa98e;box-shadow:0 0 0 3px rgba(49,92,75,.12)}.aso-exams-block{padding:6px 22px 18px}.aso-exams-block h3{margin:0 0 10px}.aso-exams-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px;max-height:220px;overflow:auto;border:1px solid #edf2ef;border-radius:12px;padding:10px}.aso-exams-list label{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px;font-size:12px;color:#30423a}.aso-exams-list input[type="date"]{border:1px solid #d8e4de;border-radius:8px;padding:6px;font-size:11px}.aso-muted{color:#68776f;margin:8px 0 0}.aso-modal footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:16px 22px;border-top:1px solid #e7eee9;background:#fbfdfc}.aso-modal .aso-table-wrap{margin:18px 22px}.aso-modal .aso-table{min-width:820px}.aso-modal .aso-empty{margin:20px}.aso-modal-backdrop .history + footer{justify-content:flex-end}
@media(max-width:1100px){.aso-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.aso-page-head{flex-direction:column}.aso-actions-head{justify-content:flex-start}.aso-table-wrap{max-height:none}}
@media(max-width:760px){.aso-kpis{grid-template-columns:1fr}.aso-form-grid{grid-template-columns:1fr}.aso-form-grid label.span-2{grid-column:span 1}.aso-exams-list{grid-template-columns:1fr}.aso-exams-list label{grid-template-columns:auto 1fr}.aso-exams-list input[type="date"]{grid-column:1 / -1}.aso-modal footer{flex-wrap:wrap;justify-content:stretch}.aso-modal footer .aso-btn{flex:1}.aso-page-head h1{font-size:25px}}


/* Correção de estabilidade do modal de ASO
   - Mantém a janela dentro da área visível
   - Cria rolagem interna no conteúdo
   - Mantém botões de ação sempre acessíveis
   - Evita que selects/date pickers fiquem cortados por overflow externo */
.aso-modal-backdrop{
  align-items:center!important;
  justify-content:center!important;
  padding:18px!important;
  overflow:hidden!important;
}
.aso-modal{
  max-height:calc(100vh - 36px)!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
.aso-modal header{
  flex:0 0 auto!important;
}
.aso-modal form{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
}
.aso-modal footer{
  position:sticky!important;
  bottom:0!important;
  z-index:20!important;
  flex:0 0 auto!important;
  box-shadow:0 -8px 18px rgba(15,23,42,.06)!important;
}
.aso-form-grid{
  padding-top:16px!important;
  gap:11px!important;
}
.aso-form-grid input,
.aso-form-grid select,
.aso-form-grid textarea{
  min-height:38px!important;
  line-height:1.2!important;
}
.aso-exams-block{
  padding-bottom:12px!important;
}
.aso-exams-list{
  max-height:150px!important;
  overflow:auto!important;
}
.aso-modal textarea{
  min-height:58px!important;
  max-height:110px!important;
}
.aso-modal select,
.aso-modal input[type="date"]{
  position:relative!important;
  z-index:30!important;
}
@media(max-height:760px){
  .aso-modal-backdrop{align-items:flex-start!important;padding:10px!important;}
  .aso-modal{max-height:calc(100vh - 20px)!important;}
  .aso-modal header{padding:14px 18px!important;}
  .aso-modal h2{font-size:18px!important;}
  .aso-modal header p{font-size:12px!important;margin-top:3px!important;}
  .aso-form-grid{padding:12px 18px 6px!important;gap:9px!important;}
  .aso-exams-block{padding:4px 18px 10px!important;}
  .aso-exams-list{max-height:118px!important;}
  .aso-modal footer{padding:12px 18px!important;}
}
@media(max-width:760px){
  .aso-modal-backdrop{align-items:flex-start!important;padding:8px!important;}
  .aso-modal{max-height:calc(100vh - 16px)!important;border-radius:14px!important;}
}

/* ===== Importação em lote de ASO ===== */
.aso-import-modal{max-width:min(920px,96vw)}
.aso-import-body{padding:18px 20px;overflow:auto;max-height:calc(92vh - 150px)}
.aso-import-help{display:grid;gap:4px;background:#f4f7f5;border:1px solid #d6e4dc;border-radius:12px;padding:12px 14px;margin-bottom:14px;color:#34433b}
.aso-import-help strong{font-size:.82rem;text-transform:uppercase;letter-spacing:.08em;color:#315c4b}
.aso-import-upload{display:flex;gap:12px;align-items:flex-end;justify-content:space-between;border:1px dashed #b8c9bf;border-radius:12px;padding:14px;margin-bottom:14px;background:#fff}
.aso-import-upload label{display:grid;gap:6px;flex:1;font-size:.78rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#5e6d66}
.aso-import-upload input{border:1px solid #dce4df;border-radius:9px;padding:10px;background:#fff;font-size:.86rem;text-transform:none;letter-spacing:0;font-weight:500;color:#1f2925}
.aso-import-errors{display:grid;gap:5px;background:#fff1f1;border:1px solid #f0caca;color:#8d2424;border-radius:12px;padding:12px 14px;margin:12px 0;font-size:.82rem}
.aso-import-errors strong{text-transform:uppercase;letter-spacing:.08em;font-size:.78rem}
.aso-import-preview{max-height:260px;margin-top:12px}
.aso-import-result{display:flex;gap:12px;align-items:center;flex-wrap:wrap;background:#eef8f2;border:1px solid #cce7d5;border-radius:12px;padding:12px 14px;margin-top:14px;color:#255d38;font-size:.86rem}
.aso-import-result strong{width:100%;text-transform:uppercase;letter-spacing:.08em;font-size:.78rem;color:#315c4b}
@media(max-width:720px){.aso-import-upload{display:grid}.aso-import-body{max-height:calc(92vh - 160px)}}


/* ===== Correção final de status do ASO e estabilidade visual da tabela ===== */
.aso-module .aso-table-card{overflow:hidden!important;}
.aso-module .aso-table-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;padding:18px 20px!important;background:#fbfdfc!important;border-bottom:1px solid #e7eee9!important;}
.aso-module .aso-table-head h2{margin:0!important;color:#07352b!important;font-size:18px!important;line-height:1.15!important;letter-spacing:.06em!important;text-transform:uppercase!important;}
.aso-module .aso-table-head p{margin:6px 0 0!important;color:#607069!important;font-size:13px!important;}
.aso-module .aso-table-head>span{display:inline-flex!important;align-items:center!important;justify-content:center!important;background:#244d3d!important;color:#fff!important;border-radius:999px!important;padding:9px 14px!important;font-size:12px!important;font-weight:900!important;text-transform:uppercase!important;white-space:nowrap!important;}
.aso-module .aso-table-wrap{overflow-x:auto!important;overflow-y:auto!important;scrollbar-gutter:stable both-edges;max-height:calc(100vh - 360px)!important;}
.aso-module .aso-table{table-layout:auto!important;min-width:1080px!important;}
.aso-module .aso-table th,.aso-module .aso-table td{white-space:normal!important;}
.aso-module .aso-table td:nth-child(1){min-width:150px!important;}
.aso-module .aso-table td:nth-child(3){min-width:150px!important;}
.aso-module .aso-table td:nth-child(4){min-width:150px!important;}
.aso-module .aso-row-actions{min-width:220px!important;text-align:left!important;}
.aso-module .aso-row-actions button{position:relative!important;z-index:3!important;}
.aso-module .aso-pill{background:#eef1f4!important;color:#5a6470!important;border:1px solid #d3d9df!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:94px!important;border-radius:999px!important;padding:6px 10px!important;font-size:10px!important;font-weight:900!important;text-transform:uppercase!important;letter-spacing:.04em!important;line-height:1.1!important;white-space:nowrap!important;box-shadow:none!important;}
.aso-module .aso-pill.aso-status-ok,.aso-module .aso-pill[data-aso-status="ok"],.aso-module .aso-pill.aso-tone-ok{background:#e8f5ee!important;color:#276446!important;border-color:#b8d9c8!important;}
.aso-module .aso-pill.aso-status-warning,.aso-module .aso-pill[data-aso-status="warning"],.aso-module .aso-pill.aso-tone-warning{background:#fff4dd!important;color:#8a5a00!important;border-color:#ebd09c!important;}
.aso-module .aso-pill.aso-status-danger,.aso-module .aso-pill[data-aso-status="danger"],.aso-module .aso-pill.aso-tone-danger{background:#fdeaea!important;color:#a83232!important;border-color:#efb3b3!important;}
.aso-module .aso-pill.aso-status-missing,.aso-module .aso-pill[data-aso-status="missing"],.aso-module .aso-pill.aso-tone-missing{background:#eef1f4!important;color:#5a6470!important;border-color:#d3d9df!important;}
.aso-module .aso-pill.aso-status-inactive,.aso-module .aso-pill[data-aso-status="inactive"],.aso-module .aso-pill.aso-tone-inactive{background:#f4efe6!important;color:#77521a!important;border-color:#dec79f!important;}
.aso-module .aso-pill.aso-status-dismissed,.aso-module .aso-pill[data-aso-status="dismissed"],.aso-module .aso-pill.aso-tone-neutral{background:#eceff3!important;color:#475569!important;border-color:#cbd5e1!important;}
.aso-module .aso-filters button[data-filter="ok"].active{background:#276446!important;border-color:#276446!important;color:#fff!important;}
.aso-module .aso-filters button[data-filter="warning"].active{background:#8a5a00!important;border-color:#8a5a00!important;color:#fff!important;}
.aso-module .aso-filters button[data-filter="danger"].active{background:#a83232!important;border-color:#a83232!important;color:#fff!important;}
.aso-module .aso-filters button[data-filter="missing"].active{background:#5a6470!important;border-color:#5a6470!important;color:#fff!important;}
.aso-module .aso-kpis article.ok{border-color:#b8d9c8!important;background:#fbfffd!important;}
.aso-module .aso-kpis article.warning{border-color:#ebd09c!important;background:#fffdf7!important;}
.aso-module .aso-kpis article.danger{border-color:#efb3b3!important;background:#fffafa!important;}
.aso-module .aso-kpis article.missing{border-color:#d3d9df!important;background:#fbfcfd!important;}
@media(max-width:1100px){.aso-module .aso-table-wrap{max-height:calc(100vh - 320px)!important}.aso-module .aso-table{min-width:1040px!important}.aso-module .aso-row-actions{min-width:200px!important}}
@media(max-width:720px){.aso-module .aso-table-head{align-items:flex-start!important;flex-direction:column!important}.aso-module .aso-table-head>span{align-self:flex-start!important}.aso-module .aso-table{min-width:980px!important}}


/* ===== Correção V5: cores forçadas por status do ASO, inclusive após filtros ===== */
.aso-module .aso-pill.danger,
.aso-module .aso-pill.aso-status-danger,
.aso-module .aso-pill.aso-tone-danger,
.aso-module .aso-pill[data-aso-status="danger"],
.aso-module .aso-pill[data-aso-tone="danger"]{
  background:#fdeaea!important;
  color:#a83232!important;
  border-color:#efb3b3!important;
}
.aso-module .aso-pill.warning,
.aso-module .aso-pill.aso-status-warning,
.aso-module .aso-pill.aso-tone-warning,
.aso-module .aso-pill[data-aso-status="warning"],
.aso-module .aso-pill[data-aso-tone="warning"]{
  background:#fff4dd!important;
  color:#8a5a00!important;
  border-color:#ebd09c!important;
}
.aso-module .aso-pill.missing,
.aso-module .aso-pill.aso-status-missing,
.aso-module .aso-pill.aso-tone-missing,
.aso-module .aso-pill[data-aso-status="missing"],
.aso-module .aso-pill[data-aso-tone="missing"]{
  background:#eef1f4!important;
  color:#5a6470!important;
  border-color:#d3d9df!important;
}
.aso-module .aso-pill.ok,
.aso-module .aso-pill.aso-status-ok,
.aso-module .aso-pill.aso-tone-ok,
.aso-module .aso-pill[data-aso-status="ok"],
.aso-module .aso-pill[data-aso-tone="ok"]{
  background:#e8f5ee!important;
  color:#276446!important;
  border-color:#b8d9c8!important;
}
.aso-module .aso-pill.inactive,
.aso-module .aso-pill.aso-status-inactive,
.aso-module .aso-pill.aso-tone-inactive,
.aso-module .aso-pill[data-aso-status="inactive"],
.aso-module .aso-pill[data-aso-tone="inactive"]{
  background:#f4efe6!important;
  color:#77521a!important;
  border-color:#dec79f!important;
}
.aso-module .aso-pill.dismissed,
.aso-module .aso-pill.neutral,
.aso-module .aso-pill.aso-status-dismissed,
.aso-module .aso-pill.aso-tone-neutral,
.aso-module .aso-pill[data-aso-status="dismissed"],
.aso-module .aso-pill[data-aso-tone="neutral"]{
  background:#eceff3!important;
  color:#475569!important;
  border-color:#cbd5e1!important;
}
.aso-module .aso-table tbody tr td .aso-pill{
  box-shadow:none!important;
}
