/* Escala 5x2 · componentes: limites por dia, equipe, horários, conferência, resumo, avisos e diálogo. */

/* ---- limites por dia da semana ---- */
.limits { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-2); }
.limit { display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: center; }
.limit label { font-size: var(--fs-1); font-weight: 600; color: var(--ink-2); }
.limit .input { height: 36px; padding: 0 2px; text-align: center; }
.limit .input:disabled { background: var(--surface-3); color: var(--ink-3); cursor: not-allowed; }
.limit small { font-size: 0.6875rem; line-height: 1.2; }

/* ---- equipe ---- */
.team-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.person + .person { border-top: 1px solid var(--line); }
.person > summary {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3);
  cursor: pointer; list-style: none; min-height: 52px;
}
.person > summary::-webkit-details-marker { display: none; }
.person > summary:hover { background: var(--surface-2); }
.person .pname { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.person .pname b { font-weight: 600; font-size: var(--fs-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .pname small { font-size: var(--fs-1); }
.person .chev { color: var(--ink-3); transition: transform 0.15s ease; }
.person .chev svg { width: 14px; height: 14px; }
.person[open] .chev { transform: rotate(180deg); }
.person-body { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3) var(--sp-4); background: var(--surface-2); }
.person-body .input, .person-body .select { background-color: var(--surface); }
.person-foot { display: flex; justify-content: flex-end; }

.dchips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.dchip {
  min-width: 42px; height: 30px; padding: 0 var(--sp-2); cursor: pointer;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: var(--r-1);
  font-size: var(--fs-1); font-weight: 600;
}
.dchip:hover { border-color: var(--ink-3); }
.dchip[aria-pressed="true"] { background: var(--off); border-color: var(--off); color: var(--off-ink); }
.dchip.is-dim { opacity: 0.55; }

.add-form { border: 1px dashed var(--line-strong); border-radius: var(--r-2); }
.add-form > summary { padding: var(--sp-3); cursor: pointer; font-size: var(--fs-2); font-weight: 600; display: flex; align-items: center; gap: var(--sp-2); list-style: none; }
.add-form > summary::-webkit-details-marker { display: none; }
.add-form > summary svg { width: 16px; height: 16px; }
.add-form form { display: flex; flex-direction: column; gap: var(--sp-3); padding: 0 var(--sp-3) var(--sp-3); }

/* ---- horários ---- */
.hlist { display: flex; flex-direction: column; gap: var(--sp-2); }
.hitem { display: flex; gap: var(--sp-2); }
.hitem .input { height: 34px; }
.hadd { display: flex; gap: var(--sp-2); }
.hadd .input { height: 34px; }

/* ---- conferência ---- */
.checks { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.check { display: flex; gap: var(--sp-4); padding: var(--sp-3) var(--sp-5); align-items: flex-start; }
.check + .check { border-top: 1px solid var(--line); }
.check .tag {
  flex: none; min-width: 84px; text-align: center; padding: 3px var(--sp-3);
  border-radius: 999px; font-size: var(--fs-1); font-weight: 700;
}
.tag.is-ok { background: var(--ok-soft); color: var(--ok); }
.tag.is-bad { background: var(--bad-soft); color: var(--bad); }
.tag.is-skip { background: var(--surface-3); color: var(--ink-3); }
.check .tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.check .tx b { font-weight: 600; font-size: var(--fs-3); }
.check .tx span { color: var(--ink-3); font-size: var(--fs-2); }
.check ul { margin-top: var(--sp-2); padding-left: var(--sp-5); list-style: disc; font-size: var(--fs-2); color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.check.is-bad { background: color-mix(in srgb, var(--bad-soft) 45%, var(--surface)); }

/* ---- resumo por colaborador ---- */
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
.people { width: 100%; border-collapse: collapse; font-size: var(--fs-2); min-width: 780px; }
.people th, .people td { padding: var(--sp-3) var(--sp-4); text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.people thead th { font-weight: 600; color: var(--ink-3); background: var(--surface-2); font-size: var(--fs-1); }
.people tbody tr:last-child th, .people tbody tr:last-child td { border-bottom: 0; }
.people .num { text-align: right; }
.person-cell { display: flex; align-items: center; gap: var(--sp-3); }
.person-cell b { display: block; font-weight: 600; }
.person-cell small { display: block; }
.dchips-read { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.dpill { padding: 2px var(--sp-2); border-radius: var(--r-1); background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: var(--fs-1); }

/* ---- avisos instantâneos ---- */
.toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: var(--sp-2); z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--primary); color: var(--primary-ink); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-2); box-shadow: var(--shadow-2); font-size: var(--fs-2); font-weight: 500; }
.toast.is-bad { background: var(--bad); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.18s ease-out; }
  @keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---- diálogo de confirmação ---- */
dialog.dlg {
  width: min(420px, calc(100vw - 32px)); padding: var(--sp-5);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-2);
}
dialog.dlg::backdrop { background: rgba(10, 16, 22, 0.5); }
dialog.dlg h3 { margin-bottom: var(--sp-2); }
dialog.dlg p { color: var(--ink-2); font-size: var(--fs-2); }
dialog.dlg menu { display: flex; justify-content: flex-end; gap: var(--sp-2); margin: var(--sp-5) 0 0; padding: 0; }

/* ---- botão "?" e janela flutuante da conferência ---- */
.btn-help { position: relative; }
.btn-help[data-count]::after {
  content: attr(data-count); position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 1;
}
.btn-help[aria-expanded="true"] { background: var(--surface-3); border-color: var(--ink-3); }

.pop {
  position: fixed; z-index: 50; top: var(--pop-top, 76px);
  right: max(16px, env(safe-area-inset-right, 0px));
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - var(--pop-top, 76px) - 16px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-3); box-shadow: var(--shadow-2);
}
.pop-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.pop-head h2 { font-size: var(--fs-4); }
.pop-head p { font-size: var(--fs-1); color: var(--ink-3); margin-top: 2px; max-width: 44ch; }
.pop .checks { border: 0; border-radius: 0; overflow-y: auto; flex: 1; min-height: 0; }
.pop .check { padding: var(--sp-3) var(--sp-5); }
@media (prefers-reduced-motion: no-preference) {
  .pop:not([hidden]) { animation: pop-in 0.14s ease-out; }
  @keyframes pop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 560px) { .pop { left: 8px; right: 8px; width: auto; } }
