:root{
  --bg:#ffffff;
  --muted:#6b7280;
  --text:#111827;
  --border:#e5e7eb;
  --soft:#f9fafb;
  --primary:#111827;
  --primary2:#2563eb;
  --danger:#dc2626;
  --ok:#16a34a;
  --warn:#f59e0b;
  --shadow: 0 10px 30px rgba(17,24,39,.08);
  --radius:14px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color:var(--text);
  background:var(--bg);
}

a{color:inherit;text-decoration:none}
a:hover{color:var(--primary2)}

.form-inline-alert{
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.45;
}
.form-inline-alert[hidden]{
  display: none !important;
}

.app-toast{
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,.12);
  font-size: 13px;
  line-height: 1.45;
  z-index: 10000;
}
.app-toast.app-toast--error{
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.app-confirm-dialog{
  padding: 0;
  border: none;
  background: #fff;
  color: var(--text);
}
.app-confirm-dialog::backdrop{
  background: rgba(17,24,39,.35);
}

.layout{
  display:grid;
  grid-template-columns: 260px 1fr;
  height:100vh;
  min-height:100vh;
  overflow:hidden;
}

.sidebar{
  border-right:1px solid var(--border);
  padding:22px 16px;
  position:sticky;
  top:0;
  height:100vh;
  background:linear-gradient(#fff, #fff);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.sidebar-top{
  flex:0 0 auto;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.sidebar-scroll{
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:6px; /* espaço pro scroll sem “cortar” bordas */
  -webkit-overflow-scrolling:touch;
}
.sidebar-footer{
  flex:0 0 auto;
}
.sidebar-close,
.mobile-topbar,
.sidebar-backdrop{
  display:none;
}

.brand{
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:10px;
  margin-bottom:18px;
}
.brand-icon{
  width:28px;
  height:28px;
  border-radius:8px;
  border:1px solid rgba(0,0,0,.08);
  background:var(--soft);
  flex:0 0 auto;
  object-fit:contain;
  padding:3px;
}
.brand-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.brand .title{font-weight:750;letter-spacing:-.02em}

/* Abas (admin Usuários / Perfis) */
.tabs-nav{
  display:flex;
  gap:4px;
  border-bottom:1px solid var(--border);
  padding-bottom:0;
}
.tab-btn{
  background:transparent;
  border:1px solid transparent;
  border-bottom:none;
  padding:10px 16px;
  cursor:pointer;
  border-radius:10px 10px 0 0;
  font-weight:650;
  font-size:14px;
  color:var(--muted);
  margin-bottom:-1px;
}
.tab-btn:hover{ color:var(--text); background:rgba(0,0,0,.03); }
.tab-btn.tab-active{
  color:var(--text);
  background:var(--bg);
  border-color:var(--border);
  border-bottom-color:var(--bg);
}
.tab-panel.hidden{ display:none !important; }
.brand .sub{font-size:12px;color:var(--muted)}

.nav-group{
  margin-top:14px;
  border-radius:12px;
}
.nav-group-summary{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  cursor:pointer;
  user-select:none;
}
.nav-group-summary:hover{
  background:rgba(0,0,0,.03);
}
.nav-group-summary::-webkit-details-marker{ display:none; }
.nav-group-summary .nav-title{
  margin:0;
}
.nav-group-chev{
  width:18px;
  height:18px;
  display:inline-block;
  position:relative;
  flex:0 0 auto;
  opacity:.8;
}
.nav-group-chev::before{
  content:"";
  position:absolute;
  inset:0;
  margin:auto;
  width:8px;
  height:8px;
  border-right:2px solid rgba(17,24,39,.55);
  border-bottom:2px solid rgba(17,24,39,.55);
  transform:rotate(-45deg);
  transition:transform .15s ease;
}
details[open] > .nav-group-summary .nav-group-chev::before{
  transform:rotate(45deg);
}
.nav-title{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  margin:14px 10px 8px;
}
.nav-group-summary .nav-title{
  margin:0;
}
.nav-group > a{
  margin-top:8px;
}
.nav-group > a:first-of-type{
  margin-top:6px;
}
.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:10px;
  color:#111827;
  background:transparent;
  border:2px solid rgba(17,24,39,.025);
  transition:background .15s, border-color .15s;
}
.nav a:hover{
  background:rgba(17,24,39,.015);
  border-color:rgba(17,24,39,.05);
}
.nav a.active{
  background:#e5e7eb;
  border:1px solid #d1d5db;
  color:#111827;
  font-weight:600;
}
.nav a.active .desc{
  color:#4b5563;
  font-weight:500;
}
.nav a .desc{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}
.nav a .stack{display:flex;flex-direction:column;line-height:1.1}

.expander{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border-radius:8px;
  border:1px solid rgba(0,0,0,.10);
  background:rgba(0,0,0,.02);
  cursor:pointer;
  user-select:none;
  font-weight:800;
  line-height:1;
}
.expander:hover{ background:rgba(0,0,0,.05); }
.expander:disabled{ opacity:.55; cursor:not-allowed; }
.subtable{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}
.subtable th,.subtable td{
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  font-size:13px;
}
.subtable th{
  background:var(--soft);
  font-size:12px;
}
.subtable tr:last-child td{ border-bottom:none; }
.content{
  padding:20px 28px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.content:has(.embed-frame-wrap){
  padding:12px 12px 16px;
  overflow-x:hidden;
}
.panel-page{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.panel-page > .card.pad{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.panel-page > .card.pad.home-hero,
.panel-page > .card.pad.embed-header{
  flex:0 0 auto;
  min-height:auto;
  overflow:visible;
}
.panel-page.group-picker-page{
  overflow:auto;
}
.panel-page.group-picker-page > .indicator-tile-grid,
.panel-page.group-picker-page > .grupo-section{
  flex:0 0 auto;
  align-self:stretch;
}
.panel-toolbar{
  flex:0 0 auto;
}
.table-scroll-wrap{
  flex:1;
  min-height:0;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:14px;
  margin-top:12px;
}
.table-scroll-wrap .table{
  border:none;
  border-radius:0;
  margin:0;
}
.cell-ellipsis{
  display:inline-block;
  max-width:180px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  vertical-align:bottom;
  cursor:default;
}
.log-filters{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:12px;
  align-items:end;
}
.pagination-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:12px;
  flex:0 0 auto;
}
.actions-inline{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.topbar h1{
  margin:0;
  font-size:20px;
  letter-spacing:-.02em;
}
.userbox{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--muted);
  font-size:13px;
}

.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
}
.card.pad{padding:16px}
.card.soft{background:var(--soft);box-shadow:none}

.grid{
  display:grid;
  gap:14px;
}
.grid.cols2{grid-template-columns: 1fr 1fr}
.grid.cols3{grid-template-columns: 1fr 1fr 1fr}

.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:flex-end;
}

/* Linhas de turma (realizar treinamento): bem compactas, data + 2 horários lado a lado */
.training-turma-head{
  margin-top:10px;
  margin-bottom:4px;
}
.training-turma-rows{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.training-turma-row{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:5px 7px;
}
.training-turma-row .tf{
  display:flex;
  flex-direction:column;
  gap:1px;
  flex:0 0 auto;
}
.training-turma-row .tf-date{ width:142px; max-width:46vw; }
.training-turma-row .tf-time{ width:104px; max-width:32vw; }
.training-turma-row label{
  display:block;
  margin:0;
  font-size:10px;
  font-weight:650;
  letter-spacing:0.03em;
  color:var(--muted);
  text-transform:uppercase;
  line-height:1.15;
}
.training-turma-row input[type="date"],
.training-turma-row input[type="time"]{
  width:100%;
  min-height:32px;
  padding:5px 8px;
  font-size:13px;
  font-variant-numeric:tabular-nums;
  border-radius:8px;
}
.training-turma-row input[type="time"]::-webkit-calendar-picker-indicator{
  cursor:pointer;
  opacity:0.7;
  margin-left:2px;
}
.training-turma-row .tf-actions{
  display:flex;
  align-items:center;
  align-self:flex-end;
  padding-bottom:1px;
}
.training-turma-row .tf-actions .btn{ padding:6px 8px; font-size:11px; border-radius:8px; }

/* Ações em tabela (Editar / Inativar lado a lado) */
.actions-inline{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:nowrap;
}
.actions-inline form{ margin:0; display:inline-flex; }
.actions-inline .btn{ white-space:nowrap; }

label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
.filter-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
  gap:16px 20px;
  align-items:end;
  max-width:900px;
}
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="number"], select, textarea{
  width:100%;
  padding:10px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  outline:none;
  background:#fff;
}
textarea{min-height:96px;resize:vertical}
input:focus, select:focus, textarea:focus{border-color:#c7d2fe;box-shadow:0 0 0 4px rgba(99,102,241,.12)}

.btn{
  border:1px solid var(--border);
  background:#fff;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:650;
}
.btn.primary{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}
.btn.blue{
  background:var(--primary2);
  color:#fff;
  border-color:var(--primary2);
}
.btn.danger{
  background:var(--danger);
  color:#fff;
  border-color:var(--danger);
}
.btn.ghost{
  background:transparent;
}
.btn:disabled{opacity:.6;cursor:not-allowed}
.btn.small{padding:8px 10px;border-radius:10px;font-size:12px}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:14px;
}
.table th, .table td{
  padding:10px 10px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
  font-size:13px;
}
.table th{
  background:var(--soft);
  text-align:left;
  color:#111827;
  font-size:12px;
  letter-spacing:.02em;
}
.table tr:last-child td{border-bottom:none}

/* Uma linha só: botões de ação compactos (cadastro treinamentos e similares) */
.table th.th-actions{
  width:1%;
  white-space:nowrap;
  text-align:right;
}
.table td.td-actions{
  white-space:nowrap;
  vertical-align:middle;
  text-align:right;
}
.table td.td-actions .actions-inline{
  flex-wrap:nowrap;
  justify-content:flex-end;
  gap:6px;
}
.table td.td-actions .actions-inline .btn.small{
  padding:6px 9px;
  font-size:11px;
  border-radius:8px;
}

.table th.th-training-sess-actions{
  width:1%;
  white-space:nowrap;
  min-width:300px;
  text-align:left;
}
.table td.td-training-sess-actions{
  white-space:nowrap;
  vertical-align:middle;
}

@media (max-width: 960px){
  .grid.cols3{grid-template-columns:1fr}
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  color:#111827;
  background:#fff;
}
.badge.ok{border-color:#bbf7d0;background:#f0fdf4;color:#166534}
.badge.bad{border-color:#fecaca;background:#fef2f2;color:#991b1b}
.badge.muted{background:var(--soft);color:var(--muted)}

.muted{color:var(--muted)}
.help{font-size:12px;color:var(--muted);margin-top:6px}
.sep{height:1px;background:var(--border);margin:14px 0}

dialog{
  border:none;
  border-radius:16px;
  width:min(760px, calc(100vw - 32px));
  max-width:calc(100vw - 24px);
  max-height:calc(100vh - 24px);
  padding:0;
  margin:auto;
  box-shadow: var(--shadow);
  background:#fff;
  color:var(--text);
  overflow:auto;
}
dialog.dialog-embed-hash{
  width:min(720px, calc(100vw - 24px));
  overflow:hidden;
}
dialog::backdrop{background:rgba(17,24,39,.35)}

.modal{
  padding:16px;
  overflow-x:hidden;
  overflow-y:visible;
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  min-width:0;
}
.modal > .head,
.modal > form,
.modal > .form-embed-hash{
  min-width:0;
  max-width:100%;
}

/* Embed hash: header fixo + form com scroll */
.modal.modal-embed-hash{
  display:flex;
  flex-direction:column;
  max-height:calc(100vh - 24px);
  min-height:0;
  overflow:hidden;
}
.modal.modal-embed-hash .head{
  flex:0 0 auto;
}
.modal.modal-embed-hash .form-embed-hash{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding-right:2px;
}

.form-embed-hash label{
  display:block;
  font-weight:650;
  margin-bottom:6px;
}
.form-embed-hash .field{
  margin-top:12px;
  min-width:0;
}
.form-embed-hash .field-inline{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  font-weight:600;
}
.form-embed-hash input[type="text"],
.form-embed-hash input:not([type]),
.form-embed-hash textarea,
.form-embed-hash .multi-select-search{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
}
.form-embed-hash .grid.cols2{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:12px;
  align-items:end;
}

.form-edit-indicator,
.form-edit-indicator .grid,
.form-edit-indicator .grid > div{
  min-width:0;
  max-width:100%;
}
.form-edit-indicator input,
.form-edit-indicator textarea,
.form-edit-indicator select{
  max-width:100%;
}
.form-edit-indicator .indicator-preview-thumb{
  width:72px;
  height:48px;
  object-fit:cover;
  border-radius:8px;
  border:1px solid var(--border);
  flex:0 0 auto;
}

.multi-select{
  position:relative;
  width:100%;
  max-width:100%;
  min-width:0;
}
.multi-select-toggle{
  margin-top:4px;
  max-width:100%;
}
.multi-select-panel{
  margin-top:8px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:10px;
  max-height:min(220px, 32vh);
  overflow:auto;
  min-width:0;
}
.multi-select-panel[hidden]{
  display:none !important;
}
.multi-select--stacked .multi-select-panel{
  display:block;
  margin-top:8px;
}
.multi-select-search{
  width:100%;
  margin-bottom:8px;
  box-sizing:border-box;
}
.multi-select-options{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}
.ms-option{
  display:flex;
  gap:8px;
  align-items:flex-start;
  margin:0;
  font-weight:500;
  min-width:0;
}
.ms-option span{
  min-width:0;
  overflow-wrap:anywhere;
  word-break:break-word;
  line-height:1.35;
}
.ms-option input{
  flex:0 0 auto;
  margin-top:2px;
}
.multi-select-summary{
  margin-top:6px;
  overflow-wrap:anywhere;
}
.embed-tutorial{
  margin-top:14px;
  padding:14px;
  border-radius:12px;
  background:rgba(37,99,235,.06);
  border:1px solid rgba(37,99,235,.15);
}
.embed-tutorial ol{
  overflow-wrap:anywhere;
}
.embed-tutorial code,
.embed-token{
  font-size:12px;
  word-break:break-all;
  overflow-wrap:anywhere;
}
.embed-indicator-list{
  max-height:min(280px, 36vh);
  overflow:auto;
  border:1px solid var(--border);
  border-radius:12px;
  padding:8px 10px;
  min-width:0;
}
.indicator-picker{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
}
.indicator-picker-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.indicator-picker-toolbar .multi-select-search{
  flex:1 1 180px;
  min-width:0;
}
.indicator-picker-actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.indicator-picker .ms-group{
  padding:6px 0;
}
.indicator-picker .ms-group + .ms-group{
  border-top:1px solid var(--border);
  margin-top:4px;
  padding-top:10px;
}
.indicator-picker .ms-group-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:6px;
  font-size:13px;
}
.indicator-picker .ms-group-options{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.embed-hash-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.td-actions .embed-token{
  display:inline-block;
  max-width:140px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  vertical-align:middle;
}

@media (max-width:640px){
  .grid.cols2{
    grid-template-columns:1fr;
  }
  .form-embed-hash .grid.cols2{
    grid-template-columns:1fr;
    align-items:stretch;
  }
  dialog{
    width:calc(100vw - 16px);
    max-width:calc(100vw - 16px);
  }
}
.import-ata-form .extra-guest-table input,
.import-ata-form .extra-guest-table select{
  margin:0;
  box-sizing:border-box;
}
.modal .head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.modal .head h3{margin:0;font-size:16px}

.thumbs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.thumbs img{
  width:130px;
  height:90px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--soft);
}

.radio-row{display:flex;gap:10px;flex-wrap:wrap}
.radio-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--border);
  padding:8px 10px;
  border-radius:999px;
  background:#fff;
}

/* Multi-select dropdown (participantes em treinamento, etc.) */
.msdd-wrap{
  position:relative;
  width:100%;
  max-width:100%;
}
.msdd-trigger{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:44px;
  padding:10px 14px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--bg);
  cursor:pointer;
  font:inherit;
  color:var(--text);
  text-align:left;
}
.msdd-trigger:hover{ border-color:#cbd5e1; background:var(--soft); }
.msdd-trigger:focus{
  outline:2px solid var(--primary2);
  outline-offset:2px;
}
.msdd-trigger .msdd-summary{
  flex:1;
  min-width:0;
  font-size:14px;
  line-height:1.35;
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
}
.msdd-trigger .msdd-chev{
  flex:0 0 auto;
  color:var(--muted);
  font-size:11px;
  letter-spacing:.02em;
  transition:transform .15s ease;
}
.msdd-wrap.is-open .msdd-chev{ transform:rotate(-180deg); }
.msdd-panel{
  display:none;
  flex-direction:column;
  min-height:0;
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 6px);
  z-index:60;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  max-height:min(520px, calc(100vh - 24px));
}
.msdd-wrap.is-open .msdd-panel{
  display:flex;
}
.msdd-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  background:var(--soft);
  flex-shrink:0;
}
.msdd-search{
  flex:1 1 160px;
  min-width:140px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  font:inherit;
}
.msdd-toolbar .btn.small{
  padding:6px 10px;
  font-size:13px;
  white-space:nowrap;
}
.msdd-list{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding:6px;
  -webkit-overflow-scrolling:touch;
}
.msdd-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
  user-select:none;
  border:1px solid transparent;
}
.msdd-row:hover{ background:var(--soft); border-color:#e8eaef; }
.msdd-row.is-hidden{ display:none !important; }
.msdd-row input[type="checkbox"]{
  margin-top:3px;
  flex:0 0 auto;
  width:18px;
  height:18px;
  accent-color:var(--primary2);
  cursor:pointer;
}
.msdd-row span.msdd-label{
  flex:1;
  line-height:1.4;
  font-size:14px;
  padding-top:1px;
}
.msdd-foot{
  font-size:12px;
  color:var(--muted);
  padding:8px 12px 10px;
  border-top:1px solid var(--border);
  background:rgba(249,250,251,.85);
  flex-shrink:0;
}

.footer-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* Avaliação: blocos de pergunta mais compactos; anexo abaixo de observação */
.assessment-questions{ gap:10px; }
.question-block{ padding:12px 14px; }
.question-header{ align-items:center; margin-bottom:8px; }
.question-title{ font-weight:700; font-size:14px; flex:1; }
.question-fields{ gap:12px; margin-bottom:8px; align-items:flex-start; }
.field-classification{ min-width:240px; flex:0 0 auto; }
.field-observation{ flex:1; min-width:0; }
.field-attachment{ margin-top:6px; padding-top:6px; border-top:1px solid var(--border); }
.field-attachment label{ margin-bottom:4px; }
.field-attachment input[type="file"]{ padding:6px 8px; font-size:13px; }
.attachment-manager{ margin-top:6px; }
.attachment-preview-list{ margin-bottom:8px; }
.attachment-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.attachment-chip{ position:relative; display:inline-flex; align-items:center; justify-content:center; background:var(--soft); border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.attachment-chip-img{ width:64px; height:64px; object-fit:cover; display:block; }
.attachment-chip-name{ padding:8px 28px 8px 12px; font-size:13px; color:var(--text); max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attachment-chip-remove{ position:absolute; top:2px; right:2px; width:22px; height:22px; padding:0; border:none; border-radius:6px; background:rgba(0,0,0,.5); color:#fff; font-size:16px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.attachment-chip-remove:hover{ background:var(--danger); }
.attachment-actions{ display:flex; gap:8px; align-items:center; }

/* Descrição da pergunta: Positivo verde, Pontos a melhorar vermelho */
.desc-positivo{ color:var(--ok); font-weight:600; }
.desc-melhorar{ color:var(--danger); font-weight:600; }

/* Resumo da avaliação: mais compacto; anexo abaixo de observação */
.summary-answer{ padding:12px 14px; }
.summary-answer-head{ margin-bottom:8px; align-items:center; }
.summary-answer-title{ font-weight:700; font-size:14px; flex:1; }
.summary-obs{ margin-bottom:8px; }
.summary-plan{ margin-bottom:8px; padding-top:8px; border-top:1px solid var(--border); }
.summary-attachments{ padding-top:8px; border-top:1px solid var(--border); }

/* —— Shell mobile: sidebar em drawer —— */
@media (max-width: 960px){
  .layout{
    display:flex;
    flex-direction:column;
    grid-template-columns:none;
    height:100dvh;
    min-height:100dvh;
    overflow:hidden;
  }

  .mobile-topbar{
    display:flex;
    align-items:center;
    gap:12px;
    flex:0 0 auto;
    min-height:52px;
    padding:8px 12px;
    border-bottom:1px solid var(--border);
    background:#fff;
    z-index:30;
  }
  .mobile-topbar__brand{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
  }
  .mobile-topbar__brand .title{
    font-weight:750;
    letter-spacing:-.02em;
    font-size:15px;
    line-height:1.1;
  }
  .mobile-topbar__brand .sub{
    font-size:11px;
    color:var(--muted);
  }

  .mobile-nav-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:40px;
    height:40px;
    padding:0;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--soft);
    cursor:pointer;
    flex:0 0 auto;
  }
  .mobile-nav-toggle__bars,
  .mobile-nav-toggle__bars::before,
  .mobile-nav-toggle__bars::after{
    display:block;
    width:18px;
    height:2px;
    border-radius:2px;
    background:#111827;
    position:relative;
  }
  .mobile-nav-toggle__bars::before,
  .mobile-nav-toggle__bars::after{
    content:"";
    position:absolute;
    left:0;
  }
  .mobile-nav-toggle__bars::before{ top:-6px; }
  .mobile-nav-toggle__bars::after{ top:6px; }

  .sidebar-backdrop{
    display:block;
    position:fixed;
    inset:0;
    z-index:40;
    background:rgba(17,24,39,.42);
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease;
  }
  .sidebar-backdrop[hidden]{
    display:none;
  }
  body.sidebar-open .sidebar-backdrop{
    opacity:1;
    pointer-events:auto;
  }

  .sidebar{
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    width:min(300px, 88vw);
    height:100dvh;
    max-height:100dvh;
    z-index:50;
    padding:16px 14px;
    transform:translateX(-105%);
    transition:transform .2s ease;
    box-shadow:none;
    overscroll-behavior:contain;
  }
  body.sidebar-open .sidebar{
    transform:translateX(0);
    box-shadow: 0 16px 48px rgba(17,24,39,.22);
  }

  .sidebar-close{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:36px;
    height:36px;
    margin:0;
    padding:0;
    border:1px solid var(--border);
    border-radius:10px;
    background:#fff;
    color:var(--text);
    font-size:22px;
    line-height:1;
    cursor:pointer;
    flex:0 0 auto;
  }

  .content{
    flex:1 1 auto;
    min-height:0;
    width:100%;
    padding:12px;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
  }
  .content:has(.embed-frame-wrap){
    padding:6px;
    overflow:hidden;
  }

  .panel-page > .card.pad.embed-header{
    padding:10px 12px !important;
  }
  .panel-page > .card.pad.embed-header h2{
    font-size:15px;
  }
  .panel-page > .card.pad.embed-header > .row{
    flex-direction:column;
    align-items:stretch !important;
    gap:8px;
  }
  .panel-page > .card.pad.embed-header > .row > .row{
    flex-wrap:wrap;
    width:100%;
    gap:6px;
  }
  .panel-page > .card.pad.embed-header > .row > .row .btn{
    flex:1 1 calc(50% - 4px);
    text-align:center;
    justify-content:center;
  }

  .indicator-tile-grid{
    grid-template-columns:1fr;
  }

  .card.pad{
    max-width:100%;
  }
  .table-wrap{
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  body.sidebar-open{
    overflow:hidden;
  }
}

@media (max-width: 960px) and (prefers-reduced-motion: reduce){
  .sidebar,
  .sidebar-backdrop{
    transition:none;
  }
}

/* Direct Query — embed de indicadores */
.embed-frame-wrap{
  flex:1 1 auto;
  width:100%;
  min-height:0;
  height:auto;
  max-height:none;
  border-radius:9px;
  overflow:hidden;
  background:#fff;
}
.embed-frame-wrap iframe{
  width:100%;
  height:100%;
  min-height:0;
  border:0;
  display:block;
  border-radius:9px;
}
.panel-page > .card.pad:has(.embed-frame-wrap){
  border-radius:9px;
  overflow:hidden;
}
.card.pad.embed-header{
  border-radius:9px;
}
.panel-page:has(.embed-frame-wrap){
  width:100%;
  max-width:none;
}
.home-hero{
  max-width:720px;
}
.home-hero h2{
  margin:0 0 8px;
  font-size:22px;
  letter-spacing:-.02em;
}
.indicator-tile-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:14px;
}
.indicator-tile{
  display:flex;
  flex-direction:column;
  gap:0;
  padding:0;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  text-align:left;
  cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.indicator-tile:hover{
  border-color:#c7d2fe;
  box-shadow:0 8px 24px rgba(15,23,42,.08);
  transform:translateY(-1px);
}
.indicator-tile-image{
  aspect-ratio:16/10;
  background:#f3f4f6;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.indicator-tile-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.indicator-tile-body{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:14px;
}
.indicator-tile-body strong{
  font-size:15px;
  line-height:1.3;
}
.folder-tile{
  flex-direction:row;
  align-items:stretch;
  min-height:0;
  border-radius:10px;
}
.folder-tile .indicator-tile-body{
  justify-content:center;
  gap:2px;
  padding:8px 12px;
  min-width:0;
}
.folder-tile .indicator-tile-body strong{
  font-size:13px;
}
.folder-tile .indicator-tile-body .help{
  font-size:11px;
}
.folder-tile-image{
  flex:0 0 auto;
  width:72px;
  aspect-ratio:auto;
  height:auto;
  align-self:stretch;
  min-height:52px;
  background:linear-gradient(160deg,#eef2ff 0%,#e0e7ff 55%,#dbeafe 100%);
}
.folder-tile-icon{
  width:28px;
  height:21px;
  border-radius:3px 3px 2px 2px;
  background:#f59e0b;
  box-shadow:inset 0 4px 0 #fbbf24;
  position:relative;
}
.folder-tile-icon::before{
  content:"";
  position:absolute;
  top:-4px;
  left:0;
  width:11px;
  height:5px;
  border-radius:2px 2px 0 0;
  background:#d97706;
}
.grupo-section:has(.folder-tile) .indicator-tile-grid{
  grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  gap:8px;
}
.grupo-section{
  margin-bottom:18px;
}
.grupo-section-title{
  margin:0 0 10px;
  font-size:13px;
  font-weight:750;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:#64748b;
}
.grupo-breadcrumb{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  margin:0 0 8px;
  font-size:13px;
}
.grupo-crumb{
  border:0;
  padding:0;
  background:transparent;
  color:#2563eb;
  font:inherit;
  font-weight:650;
  cursor:pointer;
}
.grupo-crumb.is-current{
  color:#0f172a;
  cursor:default;
}
.grupo-crumb-sep{
  color:#94a3b8;
}
.grupo-parent-row td{
  background:#f8fafc;
  border-top:1px solid var(--border);
  padding-top:12px;
  padding-bottom:12px;
}
.grupo-path-cell{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:2px;
}
.grupo-path-sub{
  font-size:12px;
}
.indicator-preview-thumb{
  width:72px;
  height:48px;
  object-fit:cover;
  border-radius:8px;
  border:1px solid var(--border);
  background:#f3f4f6;
}
.checkbox-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  gap:8px;
}
.checkbox-grid label{
  display:flex;
  gap:8px;
  align-items:center;
  margin:0;
  color:var(--text);
  font-size:13px;
}
.form-field-full{
  width:100%;
}
.profile-select-field{
  display:flex;
  flex-direction:column;
  gap:0;
}
.profile-select-field .profile-select{
  width:100%;
  min-height:42px;
  padding:10px 36px 10px 12px;
  font-size:14px;
  font-weight:600;
  color:var(--text);
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance:none;
  cursor:pointer;
}
.profile-select-field .profile-select:focus{
  border-color:#c7d2fe;
  box-shadow:0 0 0 4px rgba(99,102,241,.12);
}
.profile-select-help{
  margin:6px 0 0;
}

.panel-filters{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
}
.panel-filters .table-search{
  flex:1;
  min-width:200px;
}
.filter-ativos-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0;
  padding:8px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  color:var(--text);
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}
.filter-ativos-toggle input{
  margin:0;
}

.permission-groups{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.permission-group{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:#fafbfc;
  overflow:hidden;
}
.permission-group-head{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  background:var(--surface);
}
.permission-group-head strong{
  display:block;
  font-size:13px;
  font-weight:750;
}
.permission-group-head .help{
  margin-top:2px;
}
.permission-group-note{
  margin:0;
  padding:10px 12px;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
  border-bottom:1px solid var(--border);
  background:#fff;
}
.permission-group-items{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(200px,1fr));
  gap:8px;
  padding:12px;
}
.permission-item{
  display:flex;
  gap:8px;
  align-items:flex-start;
  margin:0;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  color:var(--text);
  font-size:13px;
  cursor:pointer;
}
.permission-item input{
  margin-top:2px;
}
.permission-item span{
  line-height:1.35;
}
.default-profile-field .help{
  margin-top:6px;
}

