
:root{
  --bg:#f7fafc;
  --panel:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --border:#e2e8f0;
  --shadow:0 10px 30px rgba(2,6,23,.08);

  --ok:#2fbf8a;
  --mid:#f2b233;
  --bad:#e5535d;

  --radius:18px;
  --radius2:14px;
}

.theme-dark{
  --bg:#0b1220;
  --panel:#0f172a;
  --text:#e5e7eb;
  --muted:#a7b0c0;
  --border:#243047;
  --shadow:0 12px 40px rgba(0,0,0,.35);
}

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

/* wide + borda leve */
.wrap{
  max-width: 1680px;
  margin: 18px auto 40px;
  padding: 0 18px;
}

.topbar{
  position:sticky; top:0;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.theme-dark .topbar{ background: rgba(11,18,32,.72); }

.topbar__inner{
  max-width:1680px;
  margin:0 auto;
  padding: 14px 18px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.brand{display:flex; gap:12px; align-items:center}
.brand__mark{
  width:42px; height:42px;
  border-radius:12px;
  display:grid; place-items:center;
  background: rgba(137,180,255,.18);
  border:1px solid rgba(137,180,255,.32);
  font-size:20px;
}
.brand__title{font-weight:900; letter-spacing:.2px}
.brand__sub{font-size:12.5px; color:var(--muted); margin-top:2px}

.topbar__actions{display:flex; gap:10px; align-items:center}

.tabs{
  max-width:1680px;
  margin:0 auto;
  padding: 0 18px 12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.tab{
  border:1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding:10px 12px;
  border-radius:999px;
  font-weight:800;
  cursor:pointer;
  box-shadow:none;
}
.tab.active{
  background: rgba(137,180,255,.22);
  border-color: rgba(137,180,255,.45);
}

.panel{display:none}
.panel.active{display:block}

h2{margin: 10px 0 14px}
h3{margin: 16px 0 8px}
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px;
  box-shadow: var(--shadow);
}
.card + .card{margin-top:14px}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:14px}
.grid3{display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:14px}
.stack{display:grid; gap:14px}
@media (max-width:980px){
  .grid2,.grid3{grid-template-columns:1fr}
}

.mini{
  border:1px solid var(--border);
  border-radius: var(--radius2);
  padding: 12px 12px;
  background: rgba(255,255,255,.5);
}
.theme-dark .mini{ background: rgba(255,255,255,.03); }
.mini__title{font-weight:900; margin-bottom:6px}
.mini__text{color:var(--muted); line-height:1.5}

.callout{
  margin-top:14px;
  border-radius: var(--radius2);
  border:1px solid rgba(137,180,255,.35);
  background: rgba(137,180,255,.12);
  padding: 12px 12px;
}
.callout--soft{
  border-color: rgba(83,229,178,.25);
  background: rgba(83,229,178,.10);
}
.callout__title{font-weight:1000; margin-bottom:6px}
.callout__text{color:var(--muted); line-height:1.5}

.scheduleBar{padding:14px}
.scheduleBar__row{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  align-items:start;
}
@media (max-width:980px){ .scheduleBar__row{grid-template-columns:1fr} }
.scheduleBar__label{font-weight:1000}
.scheduleBar__hint{margin-top:6px; color:var(--muted); font-size:12.5px}
.scheduleBar__meta{display:flex; flex-direction:column; gap:10px}
.metaText{color:var(--muted); line-height:1.45; font-size:12.8px}

.seg{
  margin-top:10px;
  display:flex;
  border:1px solid rgba(137,180,255,.45);
  border-radius:999px;
  overflow:hidden;
  width:fit-content;
  background: rgba(255,255,255,.7);
}
.theme-dark .seg{ background: rgba(255,255,255,.04); }
.seg--small .seg__btn{padding:9px 12px; font-size:13px}
.seg__btn{
  border:0;
  background: transparent;
  padding: 10px 14px;
  cursor:pointer;
  font-weight:1000;
  color:var(--text);
}
.seg__btn.active{
  background: rgba(137,180,255,.22);
}
.seg__btn:hover{background: rgba(137,180,255,.12)}

.pillline{display:flex; gap:8px; flex-wrap:wrap}
.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 1000;
  font-size: 12px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  white-space:nowrap;
}
.pill .dot{width:10px; height:10px; border-radius:50%}
.pill.ok{background: rgba(83,229,178,.10); border-color: rgba(83,229,178,.22)}
.pill.ok .dot{background: var(--ok)}
.pill.mid{background: rgba(255,211,122,.10); border-color: rgba(255,211,122,.22)}
.pill.mid .dot{background: var(--mid)}
.pill.bad{background: rgba(255,107,122,.10); border-color: rgba(255,107,122,.22)}
.pill.bad .dot{background: var(--bad)}

.toolbar{
  display:flex; gap:12px;
  align-items:center; justify-content:space-between;
  margin: 12px 0;
  flex-wrap:wrap;
}
.search{
  display:flex;
  align-items:center;
  gap:10px;
  flex: 1;
  min-width: 320px;
  border:1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  padding: 10px 12px;
}
.search__icon{opacity:.75}
.search input{
  border:0; outline:none;
  background: transparent;
  color: var(--text);
  width:100%;
  font-size:14px;
}
.filters{display:flex; gap:8px; flex-wrap:wrap}
.chip{
  border:1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-weight:900;
}
.chip.active{
  background: rgba(137,180,255,.22);
  border-color: rgba(137,180,255,.45);
}

.btn{
  border:1px solid rgba(137,180,255,.45);
  background: rgba(137,180,255,.18);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 1000;
}
.btn--ghost{
  background: transparent;
  border-color: var(--border);
}
.btn:hover{filter: brightness(0.98)}

.invalid-msg{
  margin: 10px 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius2);
  border: 1px solid rgba(255,107,122,.25);
  background: rgba(255,107,122,.08);
  color: var(--text);
  font-weight: 900;
  line-height: 1.45;
}

.tableCard{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tableCard__top{
  padding: 12px 14px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  border-bottom: 1px solid var(--border);
}
.tableCard__title{font-weight:1000}
.tableCard__count{color:var(--muted); font-weight:900}

.tableWrap{overflow:auto}
.casesTable{
  width:100%;
  border-collapse:collapse;
  font-size: 13.6px;
}
.casesTable th, .casesTable td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align:left;
  vertical-align:top;
}
.casesTable tbody tr:nth-child(even){background: rgba(255,255,255,.03)}
.theme-dark .casesTable tbody tr:nth-child(even){background: rgba(255,255,255,.02)}
.casesTable tbody tr:hover{background: rgba(137,180,255,.10)}
td.saldo{font-weight:1000}
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border-radius:999px;
  padding:6px 10px;
  font-weight:1000;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
}
.badge .dot{width:10px; height:10px; border-radius:50%}
.badge.ok{background: rgba(83,229,178,.10); border-color: rgba(83,229,178,.22)}
.badge.ok .dot{background: var(--ok)}
.badge.mid{background: rgba(255,211,122,.10); border-color: rgba(255,211,122,.22)}
.badge.mid .dot{background: var(--mid)}
.badge.bad{background: rgba(255,107,122,.10); border-color: rgba(255,107,122,.22)}
.badge.bad .dot{background: var(--bad)}

.lbl{display:block; font-weight:1000; margin-bottom:8px}
.input{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size:14px;
}
.hint{color:var(--muted); font-size:12.5px; margin-top:6px}

.simActions{display:flex; gap:10px; margin-top:12px; flex-wrap:wrap}
.result{
  margin-top: 12px;
  border:1px solid var(--border);
  border-radius: var(--radius2);
  padding: 12px 12px;
  background: rgba(255,255,255,.5);
  color: var(--muted);
  line-height:1.55;
}
.theme-dark .result{ background: rgba(255,255,255,.03); }

.faq{border:1px solid var(--border); border-radius: var(--radius2); padding: 10px 12px; background: rgba(255,255,255,.5)}
.theme-dark .faq{ background: rgba(255,255,255,.03); }
.faq + .faq{margin-top:10px}
.faq summary{cursor:pointer; font-weight:1000}
.faq p{color:var(--muted); line-height:1.55}

.footer{
  margin-top: 18px;
  color: var(--muted);
  font-size: 12.5px;
  text-align:center;
  opacity:.95;
}
.footer__sep{margin: 0 8px}


.divider{border:0;border-top:1px solid var(--border);margin:16px 0}
/* Filter chip colors */
.chip[data-risk="all"]{
  background: var(--panel);
  border-color: var(--border);
}
.chip[data-risk="ok"]{
  background: rgba(83,229,178,.14);
  border-color: rgba(83,229,178,.30);
}
.chip[data-risk="mid"]{
  background: rgba(255,211,122,.16);
  border-color: rgba(255,211,122,.32);
}
.chip[data-risk="bad"]{
  background: rgba(255,107,122,.14);
  border-color: rgba(255,107,122,.30);
}
.chip.active[data-risk="all"]{
  background: rgba(137,180,255,.22);
  border-color: rgba(137,180,255,.45);
}





/* =========================================================
   Norma badge + modal (mobile-friendly) + auditor mode
   (Adicionado pelo ajuste)
========================================================= */
.badge--norma{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  font-size:.75rem;
  font-weight:800;
  background:#eef4ff;
  color:#1e3a8a;
  border:1px solid #c7d2fe;
  cursor:pointer;
  margin-left:6px;
  white-space:nowrap;
}
.theme-dark .badge--norma{
  background: rgba(137,180,255,.18);
  border-color: rgba(137,180,255,.42);
  color: #dbeafe;
}
body.audit .badge--norma{
  outline:2px dashed rgba(37,99,235,.9);
  outline-offset: 2px;
}
.norma-modal{
  position:fixed; inset:0;
  background:rgba(2,6,23,.55);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:16px;
}
.norma-modal.active{display:flex}
.norma-card{
  background: var(--panel);
  border:1px solid var(--border);
  border-radius:18px;
  max-width:560px;
  width:100%;
  padding:18px 18px;
  box-shadow:0 25px 60px rgba(0,0,0,.25);
}
.norma-card__title{
  font-weight:1000;
  font-size:1.02rem;
  margin-bottom:6px;
  display:flex;
  gap:8px;
  align-items:center;
}
.norma-card__text{
  color: var(--text);
  line-height:1.55;
  margin-bottom:14px;
}
.norma-card__ref{
  font-size:.82rem;
  color: var(--muted);
  font-weight:900;
  margin-bottom:14px;
}
.norma-card__actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.norma-link{
  font-size:.85rem;
  font-weight:1000;
  color:#2563eb;
  text-decoration:none;
}
.norma-close{
  border:0;
  background: rgba(137,180,255,.18);
  border:1px solid rgba(137,180,255,.35);
  border-radius:12px;
  padding:8px 12px;
  font-weight:1000;
  cursor:pointer;
  color: var(--text);
}

/* =========================================================
   Formal layout toggle (1 col / 2 col)
========================================================= */
.formalTools{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin: 10px 0 6px;
}
.formalGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}
#tab-formal.formal-two .formalGrid{
  grid-template-columns: 1fr 1fr;
}
@media (max-width:980px){
  #tab-formal.formal-two .formalGrid{grid-template-columns:1fr}
}


/* Hover tooltip (card) for norma badges — desktop-friendly */
.badge--norma{position:relative}
@media (hover:hover) and (pointer:fine){
  .badge--norma::after{
    content: attr(data-text) "\A\A" attr(data-ref);
    white-space: pre-wrap;
    position:absolute;
    left:0;
    top:calc(100% + 10px);
    z-index: 9998;
    width: 360px;
    max-width: min(420px, 90vw);
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 18px 40px rgba(2,6,23,.18);
    opacity:0;
    transform: translateY(-6px);
    pointer-events:none;
    transition: all .16s ease;
  }
  .badge--norma::before{
    content:"";
    position:absolute;
    left: 18px;
    top: 100%;
    border: 8px solid transparent;
    border-top-color: var(--panel);
    opacity:0;
    transform: translateY(-6px);
    transition: all .16s ease;
  }
  .badge--norma:hover::after,
  .badge--norma:hover::before{
    opacity:1;
    transform: translateY(0);
  }
}







/* grid 2 colunas no topo dos Casos */
.scheduleGrid{
  display:grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px){
  .scheduleGrid{ grid-template-columns: 1fr; }
}

/* expander (details/summary) */
.expander{
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.03);
}
.expander__sum{
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 700;
  list-style: none;
}
.expander__sum::-webkit-details-marker{ display:none; }
.expander__body{
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* toolbar empilhado dentro do expander */
.toolbar--stack{
  display: grid;
  gap: 10px;
}


/* segmented tabs (top) */
.segmented{
  display:flex;
  gap:6px;
  padding:6px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:999px;
  background:rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.seg__tab{
  flex:1;
  border:0;
  background:transparent;
  padding:10px 14px;
  border-radius:999px;
  font-weight:600;
  cursor:pointer;
  color:inherit;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.seg__tab:hover{ background:rgba(0,0,0,.04); }
.seg__tab.is-active{
  background:rgba(60,120,255,.14);
  box-shadow: inset 0 0 0 1px rgba(60,120,255,.25);
}
@media (max-width:720px){
  .seg__tab{ font-size:14px; padding:10px 10px; }
}

/* PDF embutido no modal (Norma/CLT) */
.norma-pdf{
  margin-top:12px;
  border:1px solid rgba(0,0,0,.10);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
}
#normaPdfFrame{
  width:100%;
  height:min(70vh, 560px);
  border:0;
  display:block;
}

/* =========================================================
   FAQ interativo
========================================================= */
.faq-hero { padding: 18px; }
.faq-searchrow{ display:flex; gap:12px; align-items:center; margin: 12px 0 10px; }
.faq-search{ flex:1; display:flex; align-items:center; gap:10px; background: rgba(0,0,0,.04); border:1px solid rgba(0,0,0,.08); border-radius: 999px; padding: 10px 14px; }
body.theme-dark .faq-search{ background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); }
.faq-search__icon{ opacity:.7; }
#faqSearch{ border:0; outline:0; width:100%; background:transparent; font: inherit; }
.faq-filters{ display:flex; flex-wrap:wrap; gap:10px; }
.faq-chip{ border:1px solid rgba(0,0,0,.10); background: rgba(255,255,255,.7); padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor:pointer; }
body.theme-dark .faq-chip{ background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.faq-chip.is-active{ box-shadow: 0 0 0 3px rgba(59,130,246,.25); border-color: rgba(59,130,246,.45); }

.faq-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:14px; margin-top:14px; }
@media (max-width: 920px){ .faq-grid{ grid-template-columns: 1fr; } }

.faq-card{ padding: 14px 16px; }
.faq-card summary{ list-style:none; cursor:pointer; font-weight: 800; }
.faq-card summary::-webkit-details-marker{ display:none; }
.faq-card__head{ display:flex; align-items:center; gap:10px; justify-content:space-between; }
.faq-tag{ font-size:12px; font-weight:800; padding:5px 10px; border-radius:999px; background: rgba(59,130,246,.10); border: 1px solid rgba(59,130,246,.20); }
body.theme-dark .faq-tag{ background: rgba(59,130,246,.18); border-color: rgba(59,130,246,.30); }
.faq-answer{ margin-top: 10px; line-height: 1.45; }
.cite-badge{
  display:inline-flex; align-items:center; gap:8px;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(59,130,246,.10);
  border: 1px solid rgba(59,130,246,.22);
  font-weight: 800; font-size: 12px;
  cursor: pointer; user-select:none;
}
.cite-badge:hover{ filter: brightness(1.02); }
body.theme-dark .cite-badge{ background: rgba(59,130,246,.18); border-color: rgba(59,130,246,.30); }

/* =========================================================
   PDF Modal (viewer interno)
========================================================= */
.pdf-modal{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 9999;
}
.pdf-modal.active{ display:flex; }

.pdf-card{
  width: min(980px, 96vw);
  height: min(720px, 90vh);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.10);
  overflow: hidden;
  display:flex;
  flex-direction:column;
}
body.theme-dark .pdf-card{
  background: #0b1220;
  border-color: rgba(255,255,255,.10);
}
.pdf-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
body.theme-dark .pdf-head{ border-bottom-color: rgba(255,255,255,.10); }
.pdf-title{ font-weight: 900; }
.pdf-actions{ display:flex; gap:10px; align-items:center; }
.pdf-btn{
  border:1px solid rgba(0,0,0,.12);
  background: rgba(59,130,246,.10);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}
body.theme-dark .pdf-btn{ border-color: rgba(255,255,255,.12); background: rgba(59,130,246,.18); }

#pdfFrame{
  width:100%;
  height:100%;
  border:0;
  background: transparent;
}
