:root {
  --ink: #12110f;
  --paper: #f3efe6;
  --amber: #e8a317;
  --amber-deep: #c47f00;
  --line: rgba(18, 17, 15, 0.12);
  --muted: rgba(18, 17, 15, 0.62);
  --panel: rgba(255, 252, 245, 0.78);
  --shadow: 0 24px 60px rgba(18, 17, 15, 0.14);
  --font-display: "Bebas Neue", sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: clip;
  width: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(232, 163, 23, 0.28), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(18, 17, 15, 0.18), transparent 50%),
    linear-gradient(165deg, #f7f2e8 0%, #e7e0d2 48%, #d9d1c0 100%);
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.hero, main, footer { position: relative; z-index: 1; }

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1.25rem;
  padding: clamp(1.25rem, 3.5vw, 2.75rem);
  padding-bottom: 1rem;
  animation: rise 0.9s ease both;
}
.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.25rem 2rem;
  align-items: end;
}
.hero-inner { max-width: 36rem; }

.brand {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.5vw, 4rem);
  letter-spacing: 0.06em;
  line-height: 0.95;
  color: var(--ink);
  animation: brandIn 1s ease both;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 22ch;
  line-height: 1.25;
}

.lead {
  margin: 0.75rem 0 1.2rem;
  color: var(--muted);
  font-size: 1rem;
  max-width: 40ch;
  line-height: 1.5;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-live {
  margin: 0;
  align-self: end;
  padding: 0.95rem 1.05rem;
  border-radius: 1rem;
  border: 1px solid rgba(18, 17, 15, 0.1);
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
  animation: fadeUp 0.9s ease 0.1s both;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: var(--ink);
  color: var(--paper);
}
.btn.primary:hover { background: #000; }
.btn.ghost {
  background: transparent;
  border-color: rgba(18, 17, 15, 0.28);
  color: var(--ink);
}

.tower {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-height: 0;
  animation: fadeUp 0.85s ease 0.12s both;
}
.tower-filters {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(6.5rem, 10rem)) minmax(8rem, 1fr) auto auto;
  gap: 0.75rem 1rem;
  align-items: end;
}
.tower-filters label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tower-filters select {
  width: 100%;
  border: 1px solid rgba(18, 17, 15, 0.18);
  border-radius: 0.7rem;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fffdf8;
  color: var(--ink);
}
.sel-ceem {
  max-width: 100%;
  text-overflow: ellipsis;
}
.btn-clear {
  appearance: none;
  border: 1px solid rgba(18, 17, 15, 0.22);
  background: transparent;
  color: var(--ink);
  border-radius: 0.7rem;
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  align-self: end;
}
.btn-clear:hover {
  border-color: rgba(154, 106, 0, 0.55);
  color: var(--amber-deep);
}
.btn-clear:focus-visible {
  outline: 2px solid #9a6a00;
  outline-offset: 2px;
}
.btn-xlsx {
  appearance: none;
  border: 1px solid rgba(154, 106, 0, 0.45);
  background: #fff8e8;
  color: var(--amber-deep);
  border-radius: 0.7rem;
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  align-self: end;
}
.btn-xlsx:hover {
  background: #f3e2b8;
}
.btn-xlsx:focus-visible {
  outline: 2px solid #9a6a00;
  outline-offset: 2px;
}
.filters-actions {
  display: flex;
  align-items: end;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tower-unit {
  margin: 0;
  align-self: end;
  color: var(--muted);
  font-size: 0.86rem;
  padding-bottom: 0.35rem;
}
.tower-unit b { color: var(--ink); }
.tower-uni {
  margin: -0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.tower-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.75rem 0.8rem;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  background: rgba(232, 163, 23, 0.08);
}
.tower-trio b {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: 0.03em;
  line-height: 0.95;
}
.tower-trio em {
  display: block;
  margin-top: 0.15rem;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
}
#tw-saldo-wrap.is-up b { color: #1f6b3a; }
#tw-saldo-wrap.is-down b { color: #9a3412; }
.tower-card {
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(18, 17, 15, 0.1);
  border-radius: 1.15rem;
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.85rem;
  align-content: start;
}
.tower-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.tower-card header strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.tower-big {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.tower-big b {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: 0.03em;
  line-height: 0.95;
}
.tower-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  color: var(--muted);
  font-size: 0.86rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.tower-mini b { color: var(--ink); font-weight: 700; }
.tower-spark {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 0.28rem;
  min-height: 4.6rem;
  padding-top: 0.2rem;
}
.tower-spark-col {
  display: grid;
  grid-template-rows: 3.2rem auto;
  align-items: end;
  gap: 0.28rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.tower-spark-col:focus-visible {
  outline: 2px solid #9a6a00;
  outline-offset: 2px;
  border-radius: 0.35rem;
}
.tower-spark-bar {
  display: block;
  width: 100%;
  align-self: end;
  border-radius: 0.35rem 0.35rem 0.15rem 0.15rem;
  background: linear-gradient(180deg, #e8a317, #9a6a00);
  min-height: 0.25rem;
  opacity: 0.9;
  transition: height 0.25s ease, opacity 0.2s ease, background 0.2s ease;
}
.tower-spark-col:hover .tower-spark-bar {
  opacity: 1;
}
.tower-spark-col.is-peak .tower-spark-bar {
  opacity: 1;
  filter: brightness(1.06);
}
.tower-spark-col.is-active .tower-spark-bar {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(154, 106, 0, 0.45);
}
.tower-spark-lab {
  display: block;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}
.tower-spark-col.is-active .tower-spark-lab {
  color: var(--amber-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.tower-spark-col.is-peak:not(.is-active) .tower-spark-lab {
  color: var(--ink);
  font-weight: 600;
}

.hero-foot {
  display: grid;
  gap: 0.75rem;
}
.hero-strip {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: baseline;
}
.hero-strip span:not(.dot) {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--amber-deep);
  letter-spacing: 0.03em;
}

.scroll-cue {
  appearance: none;
  border: 1px dashed rgba(18, 17, 15, 0.28);
  background: rgba(255, 253, 248, 0.55);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  animation: cuePulse 1.8s ease-in-out infinite;
}
.scroll-cue:hover { background: rgba(255, 253, 248, 0.9); }
.scroll-arrow {
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  animation: arrowBounce 1.4s ease-in-out infinite;
}
@keyframes cuePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 163, 23, 0); }
  50% { box-shadow: 0 0 0 6px rgba(232, 163, 23, 0.12); }
}
@keyframes arrowBounce {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50% { transform: translateY(4px) rotate(45deg); }
}

@media (max-width: 900px) {
  .hero-top,
  .tower { grid-template-columns: 1fr; }
  .tower-filters { grid-template-columns: 1fr 1fr; }
  .tower-unit { grid-column: 1 / -1; }
  .tower-trio { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
}

/* Mostra função quando filtramos por ela */
#table-horas th:nth-child(4),
#table-horas td:nth-child(4) {
  display: table-cell;
}
td.funcao {
  white-space: normal;
  max-width: 12rem;
  line-height: 1.3;
}
td.filial {
  white-space: normal;
  max-width: 12rem;
  line-height: 1.3;
}
tr.row-vermelho {
  background: rgba(180, 83, 9, 0.09);
}
tr.row-vermelho:hover {
  background: rgba(180, 83, 9, 0.16);
}
tr.row-amber {
  background: rgba(232, 163, 23, 0.1);
}
tr.row-amber:hover {
  background: rgba(232, 163, 23, 0.18);
}
tr.row-interjornada {
  background: rgba(192, 57, 43, 0.14);
}
tr.row-interjornada:hover {
  background: rgba(192, 57, 43, 0.22);
}
tr.row-sem-folga {
  box-shadow: inset 4px 0 0 0 #6b4fa0;
}
.ritmo-bar {
  display: block;
  width: 2.5rem;
  height: 0.6rem;
  border-radius: 999px;
  background: rgba(18, 17, 15, 0.08);
  overflow: hidden;
}
.ritmo-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
}
.ritmo-fill.verde { background: #2f7d4a; }
.ritmo-fill.amber { background: var(--amber); }
.ritmo-fill.vermelho { background: #b45309; }

.warn-badge {
  color: #b45309;
  font-weight: 700;
  cursor: help;
}
.warn-badge.folga {
  color: #6b4fa0;
}

main {
  padding: 0 clamp(1.5rem, 4vw, 3.5rem) 4rem;
  display: grid;
  gap: 2.5rem;
  min-width: 0;
  max-width: 100%;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(18, 17, 15, 0.08);
  border-radius: 1.25rem;
  padding: clamp(1.2rem, 2.5vw, 2rem);
  box-shadow: var(--shadow);
  animation: fadeUp 0.7s ease both;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.1rem);
  letter-spacing: 0.04em;
  line-height: 1;
}
.panel-head p {
  margin: 0.35rem 0 1.25rem;
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 1.1rem;
  align-items: end;
}
.filters label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.filters input,
.filters select {
  width: 100%;
  border: 1px solid rgba(18, 17, 15, 0.18);
  border-radius: 0.7rem;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fffdf8;
  color: var(--ink);
}

.pulse {
  margin: 0 0 1.1rem;
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 1rem;
  border: 1px solid rgba(18, 17, 15, 0.1);
  background:
    linear-gradient(135deg, rgba(232, 163, 23, 0.12), transparent 42%),
    rgba(255, 253, 248, 0.92);
  animation: fadeUp 0.55s ease both;
}
.pulse-hero {
  display: grid;
  grid-template-columns: auto auto minmax(12rem, 1fr);
  gap: 1.25rem 1.75rem;
  align-items: end;
  margin-bottom: 1rem;
}
.pulse-block strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.7rem);
  letter-spacing: 0.03em;
  line-height: 0.95;
}
.pulse-block em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.85rem;
}
.pulse-k {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.pulse-saldo.is-up strong { color: #1f6b3a; }
.pulse-saldo.is-down strong { color: #9a3412; }
.pulse-saldo.is-flat strong { color: var(--ink); }

.pulse-meter-wrap { min-width: 0; }
.pulse-track {
  display: flex;
  height: 0.85rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(18, 17, 15, 0.08);
  margin: 0.45rem 0 0.55rem;
}
.pulse-fill { height: 100%; transition: width 0.45s ease; }
.pulse-fill.above { background: #2f7d4a; }
.pulse-fill.alvo { background: var(--amber); }
.pulse-fill.below { background: #b45309; }
.pulse-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.pulse-legend .dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-right: 0.25rem;
  vertical-align: middle;
}
.pulse-legend .dot.above { background: #2f7d4a; }
.pulse-legend .dot.alvo { background: var(--amber); }
.pulse-legend .dot.below { background: #b45309; }
.pulse-legend b { color: var(--ink); font-weight: 700; }

.pulse-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.pulse-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.03em;
  line-height: 1;
  margin-top: 0.15rem;
}
.pulse-atest .pulse-stats { border-top: 0; padding-top: 0; }
.pulse-atest {
  display: grid;
  gap: 1rem;
}
.spark-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.spark-note {
  font-size: 0.82rem;
  color: var(--muted);
}
.spark-note b { color: var(--ink); font-weight: 700; }
.spark-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(2.2rem, 1fr);
  align-items: end;
  gap: 0.45rem;
  min-height: 7.5rem;
  padding: 0.35rem 0.15rem 0;
  border-top: 1px dashed rgba(18, 17, 15, 0.12);
  position: relative;
}
.spark-avg-line {
  position: absolute;
  left: 2%;
  right: 2%;
  height: 0;
  border-top: 1.5px dashed rgba(196, 127, 0, 0.85);
  pointer-events: none;
  z-index: 1;
}
.spark-col {
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: end;
  justify-items: center;
  gap: 0.25rem;
  height: 100%;
  min-height: 7rem;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
}
.spark-col:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 0.4rem;
}
.spark-bar-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  position: relative;
}
.spark-bar {
  width: 68%;
  max-width: 2rem;
  border-radius: 0.55rem 0.55rem 0.2rem 0.2rem;
  background: linear-gradient(180deg, #e8a317 0%, #9a6a00 100%);
  min-height: 0.35rem;
  transition: height 0.45s ease, transform 0.2s ease, filter 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}
.spark-col:hover .spark-bar,
.spark-col.is-hot .spark-bar {
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.spark-col.is-dim .spark-bar {
  opacity: 0.45;
  filter: none;
  transform: none;
}
.spark-col.is-active .spark-bar {
  filter: brightness(1.08);
  box-shadow: 0 0 0 2px rgba(154, 106, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.35);
}
.spark-val {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink);
}
.spark-col.is-dim .spark-val { color: var(--muted); }
.spark-lab {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.spark-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem 0;
}

@media (max-width: 900px) {
  .pulse-hero { grid-template-columns: 1fr 1fr; }
  .pulse-meter-wrap { grid-column: 1 / -1; }
  .pulse-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  max-width: 100%;
  width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  table-layout: auto;
}
th, td {
  padding: 0.55rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}
td.nome {
  white-space: normal;
  min-width: 8rem;
  max-width: 14rem;
  line-height: 1.35;
  word-break: break-word;
}
th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: rgba(18, 17, 15, 0.03);
  position: sticky;
  top: 0;
  white-space: nowrap;
}
th.th-sort {
  cursor: pointer;
  user-select: none;
}
th.th-sort:hover {
  color: var(--ink);
}
th.th-sort::after {
  content: "↕";
  margin-left: 0.3em;
  opacity: 0.4;
}
th.th-sort.is-sorted::after {
  opacity: 1;
  color: var(--amber-deep);
}
th.th-sort.sort-asc::after {
  content: "↑";
}
th.th-sort.sort-desc::after {
  content: "↓";
}
tbody tr:hover { background: rgba(232, 163, 23, 0.08); }
.hint { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.9rem; }

button.link-nome {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(196, 127, 0, 0.55);
  text-underline-offset: 0.18em;
}
button.link-nome:hover {
  color: var(--amber-deep);
  text-decoration-color: var(--amber-deep);
}

.sheet[hidden] { display: none !important; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  justify-items: end;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 17, 15, 0.42);
  backdrop-filter: blur(2px);
  animation: fadeUp 0.25s ease both;
}
.sheet-panel {
  position: relative;
  z-index: 1;
  width: min(66rem, 100vw);
  height: 100%;
  background: #fffdf8;
  border-left: 1px solid rgba(18, 17, 15, 0.12);
  box-shadow: -24px 0 60px rgba(18, 17, 15, 0.22);
  padding: 1.25rem 1.25rem 1.5rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.85rem;
  animation: sheetIn 0.28s ease both;
  overflow: hidden;
}
@keyframes sheetIn {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}
.sheet-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-head h3 {
  margin: 0.2rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: 0.03em;
  line-height: 1;
}
.sheet-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.sheet-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  background: rgba(232, 163, 23, 0.08);
}
@media (min-width: 520px) {
  .sheet-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sheet-summary span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-summary strong {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
}
.sheet-table {
  min-height: 0;
  overflow: auto;
}
td.marcacoes {
  white-space: normal;
  line-height: 1.4;
  min-width: 16rem;
}
.sheet-close { flex-shrink: 0; }
.esc-h { font-variant-numeric: tabular-nums; white-space: nowrap; }
.esc-dur { color: var(--muted); font-size: 0.8em; }
.esc-sub { color: var(--muted); font-size: 0.76rem; line-height: 1.25; max-width: 15rem; }
.esc-tipo { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
td.escala { min-width: 9rem; }
.cond-toggle {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.cond-toggle .seta { display: inline-block; transition: transform 0.15s; font-size: 0.7em; margin-left: 0.2rem; }
.cond-toggle[aria-expanded="true"] .seta { transform: rotate(90deg); }
tr.row-trechos td { background: rgba(232, 163, 23, 0.06); padding: 0.4rem 0.75rem 0.7rem 2rem; }
.trechos-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.trechos-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.9rem; align-items: baseline; font-size: 0.88rem; }
.trechos-lista .rota { font-weight: 600; }
.trechos-lista .hora { font-variant-numeric: tabular-nums; }
.trechos-lista .meta { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.trechos-lista .est { color: #b45309; }


footer {
  padding: 1.5rem clamp(1.5rem, 4vw, 3.5rem) 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-nota {
  margin-top: 0.6rem;
  max-width: 62rem;
  font-size: 0.78rem;
  line-height: 1.5;
  opacity: 0.85;
}
.footer-nota strong {
  color: var(--ink);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes brandIn {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1100px) {
  #table-horas th:nth-child(7),
  #table-horas td:nth-child(7),
  #table-horas th:nth-child(10),
  #table-horas td:nth-child(10) {
    display: none;
  }
  #table-atestados th:nth-child(7),
  #table-atestados td:nth-child(7),
  #table-atestados th:nth-child(8),
  #table-atestados td:nth-child(8),
  #table-atestados th:nth-child(9),
  #table-atestados td:nth-child(9) {
    display: none;
  }
  td.nome { max-width: 11rem; }
}

@media (max-width: 700px) {
  #table-horas th:nth-child(6),
  #table-horas td:nth-child(6),
  #table-horas th:nth-child(8),
  #table-horas td:nth-child(8) {
    display: none;
  }
  td.nome { max-width: 9rem; }
}

/* ---- Tela CEEM ---- */
.ceem-filter-bar {
  background: #fdf6d8;
  border: 1px solid rgba(18, 17, 15, 0.15);
  border-radius: 0.85rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.ceem-filter-title {
  margin: 0 0 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
}
.ceem-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem 1.25rem;
}
.ceem-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ceem-filter-grid select,
.ceem-filter-grid input {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.ceem-kpis,
.ceem-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ceem-kpi,
.ceem-metric {
  flex: 1 1 12rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}
.ceem-kpi b,
.ceem-metric b {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--amber-deep);
  letter-spacing: 0.02em;
}
.ceem-subhead {
  margin: 1.5rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.ceem-kpi-ico,
.ceem-metric-ico {
  font-size: 1.1rem;
}
#table-ceem tfoot .ceem-total-row td {
  font-weight: 700;
  background: rgba(18, 17, 15, 0.05);
  border-top: 2px solid var(--line);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 3.5vw, 2.75rem);
  position: relative;
  z-index: 1;
}
.topbar .brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.06em;
  color: var(--ink);
}
.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.construcao-aviso {
  margin: 0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(232, 163, 23, 0.16);
  color: #8a5a06;
  font-size: 0.82rem;
  font-weight: 600;
}

.landing {
  max-width: 60rem;
  margin: 2vh auto;
}
.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.landing-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 252, 245, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.landing-card:hover,
.landing-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  outline: none;
}
.landing-ico { font-size: 2.2rem; line-height: 1; }
.landing-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}
.landing-text { color: var(--muted); }

.view { position: relative; }
.btn-back { margin-bottom: 1rem; }

/* Multi-select (checkbox dropdown) usado nos filtros CEEM */
.ms {
  position: relative;
}
.ms-toggle {
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.ms-toggle:hover {
  border-color: rgba(154, 106, 0, 0.45);
}
.ms-panel {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  z-index: 5;
  min-width: 100%;
  max-height: 14rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  box-shadow: var(--shadow);
  padding: 0.35rem;
}
.ms-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
}
.ms-opt:hover {
  background: rgba(18, 17, 15, 0.05);
}
.ms-opt-all {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
  font-weight: 700;
}
.ceem-updated {
  margin: 0 0 0.9rem;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---- Folha ponto (painel lateral) ---- */
table.fp { border-collapse: separate; border-spacing: 0; width: 100%; }
table.fp thead th { position: sticky; top: 0; z-index: 2; background: #f6f1e5; padding: 0.55rem 0.7rem; text-align: left; white-space: nowrap; }
table.fp thead th small { display: block; font-weight: 500; font-size: 0.66rem; letter-spacing: 0; text-transform: none; color: var(--muted); }
table.fp td { padding: 0.55rem 0.7rem; vertical-align: top; border-bottom: 1px solid var(--line); }
table.fp tbody tr:hover > td { background: rgba(232, 163, 23, 0.07); }
.fp-data { white-space: nowrap; width: 4.6rem; }
.fp-dia { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.fp-sem { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.fp-sem.fim { color: #b45309; font-weight: 700; }
.fp-alerta { color: #c0392b; font-size: 0.85rem; }
.fp-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.chip { font-variant-numeric: tabular-nums; font-size: 0.78rem; padding: 0.08rem 0.4rem; border-radius: 0.4rem; background: rgba(18, 17, 15, 0.06); }
.chip-mais { background: rgba(107, 79, 160, 0.12); color: #4b3678; }
.fp-vazio { color: var(--muted); font-size: 0.8rem; opacity: 0.7; }
.fp-hrs { display: flex; gap: 0.9rem; margin-top: 0.3rem; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.fp-trab { font-weight: 700; }
.fp-trab.neg { color: #c0392b; }
.fp-prev { color: var(--muted); }
.fp-especial { font-weight: 600; color: var(--muted); }
.fp-ico { margin-right: 0.4rem; }
tr.row-atestado td { background: rgba(192, 57, 43, 0.06); }
tr.row-feriado td { background: rgba(47, 125, 74, 0.08); }
tr.row-descanso td { background: rgba(18, 17, 15, 0.035); }
.esc-topo { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.esc-h { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.esc-dur { color: var(--muted); font-size: 0.75rem; }
.esc-rota { margin-top: 0.2rem; font-size: 0.75rem; color: var(--muted); max-width: 17rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.b-via { background: rgba(232, 163, 23, 0.22); color: #7a5200; }
.b-folga { background: rgba(47, 125, 74, 0.16); color: #25613a; }
.b-alerta { background: rgba(192, 57, 43, 0.16); color: #8f2a1f; }
.b-outro { background: rgba(18, 17, 15, 0.08); color: var(--ink); }
.fp-cond { white-space: nowrap; }
.cond-val { font-weight: 700; font-variant-numeric: tabular-nums; }
table.fp .cond-toggle { text-decoration: none; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.1rem 0.45rem; background: #fff; }
table.fp .cond-toggle:hover { border-color: var(--amber-deep); }
.cond-n { margin-left: 0.4rem; font-size: 0.68rem; color: var(--muted); font-weight: 600; }
.cond-n::before { content: "×"; }
th.th-cond { cursor: pointer; }

/* ---- Folha: separacao por blocos (ponto | escala | conducao) ---- */
table.fp thead th:nth-child(2) { background: #ecebe6; }
table.fp thead th:nth-child(3) { background: #f7ebc9; }
table.fp thead th:nth-child(4) { background: #dfeaf5; }
table.fp td:nth-child(2), table.fp th:nth-child(2),
table.fp td:nth-child(3), table.fp th:nth-child(3),
table.fp td:nth-child(4), table.fp th:nth-child(4) { border-left: 1px solid rgba(18, 17, 15, 0.16); }
table.fp td:nth-child(3) { background-image: linear-gradient(rgba(232, 163, 23, 0.045), rgba(232, 163, 23, 0.045)); }
table.fp td:nth-child(4) { background-image: linear-gradient(rgba(60, 120, 190, 0.04), rgba(60, 120, 190, 0.04)); }
table.fp tbody tr:nth-child(even):not(.row-trechos):not(.row-atestado):not(.row-feriado):not(.row-descanso) > td:nth-child(1),
table.fp tbody tr:nth-child(even):not(.row-trechos):not(.row-atestado):not(.row-feriado):not(.row-descanso) > td:nth-child(2) { background-color: rgba(18, 17, 15, 0.022); }
table.fp td { border-bottom-color: rgba(18, 17, 15, 0.09); }
tr.row-trechos td { border-left: 0 !important; }
.esc-topo { flex-wrap: nowrap; }

/* ---- Jornadas: caber na tela sem rolar para o lado ---- */
#view-operacional, #view-operacional > *, #view-gerencial, #view-gerencial > *, section.panel { min-width: 0; max-width: 100%; }
#view-gerencial .ceem-filter-grid, #view-gerencial .filters { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
#view-gerencial .ceem-kpi, #view-gerencial .ceem-metric { flex: 1 1 9rem; min-width: 0; padding: 0.65rem 0.8rem; }
#view-gerencial table { font-size: 0.8rem; }
#view-gerencial th, #view-gerencial td { padding: 0.45rem 0.45rem; }
#view-gerencial th { white-space: normal; line-height: 1.15; vertical-align: bottom; }
#table-horas { font-size: 0.8rem; }
#table-horas th, #table-horas td { padding: 0.45rem 0.4rem; }
#table-horas th { white-space: normal; line-height: 1.15; vertical-align: bottom; letter-spacing: 0.02em; }
#table-horas td.nome { white-space: normal; max-width: 11rem; line-height: 1.25; }
#table-horas td.filial { max-width: 8.5rem; }
#table-horas td.funcao { max-width: 8rem; }
#table-horas td:nth-child(n+5):not(.funcao):not(.nome) { font-variant-numeric: tabular-nums; }
.ceem-metric .ceem-lbl, .ceem-kpi .ceem-lbl { min-width: 0; line-height: 1.25; }
#view-gerencial .ceem-metric { flex: 1 1 10rem; }
#view-gerencial .ceem-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
#view-gerencial .ceem-metric .ceem-lbl { flex: 1; }
#view-gerencial .ceem-metric b { flex: none; }
#view-gerencial th[title], #view-gerencial .ceem-kpi[title], #view-gerencial .ceem-metric[title] { cursor: help; }
#view-gerencial th[title] { text-decoration: underline dotted rgba(18,17,15,0.35); text-underline-offset: 3px; }

/* Tabelas do CEEM: cabecalho compacto pra caber as colunas sem cortar */
#view-gerencial .table-wrap th { padding: 0.5rem 0.4rem; font-size: 0.7rem; letter-spacing: 0.03em; line-height: 1.25; white-space: normal; vertical-align: bottom; }
#view-gerencial .table-wrap td { padding: 0.5rem 0.4rem; }
#view-gerencial .table-wrap th:not(:first-child), #view-gerencial .table-wrap td:not(:first-child) { text-align: right; }
#view-gerencial .table-wrap th:nth-child(5), #view-gerencial .table-wrap td:nth-child(5) { text-align: center; width: 1.6rem; }

/* aviso de periodo ainda aberto (dados parciais do RM) */
.aviso-mes {
  margin: 0.5rem 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid #e0b252;
  border-left-width: 4px;
  border-radius: 8px;
  background: #fdf3da;
  color: #7a4b00;
  font-size: 0.88rem;
}
.aviso-mes[hidden] { display: none; }
@media (prefers-color-scheme: dark) {
  .aviso-mes { background: #3a2c0d; color: #f3d28a; border-color: #8a6a22; }
}
/* CEEM com 15 colunas: compactar para caber sem rolar */
#view-gerencial table { font-size: 0.74rem; }
#view-gerencial th, #view-gerencial td { padding: 0.4rem 0.25rem; }
#view-gerencial th { letter-spacing: 0; font-size: 0.62rem; }
#view-gerencial td:first-child, #view-gerencial th:first-child { white-space: normal; max-width: 8.5rem; min-width: 6rem; }
#ceem.panel { padding-left: 1rem; padding-right: 1rem; }

/* Vídeo de apresentação na página inicial */
.landing-ajuda { margin-top: 1.5rem; padding: 1.1rem 1.25rem; border: 1px solid var(--border, #d9dee7); border-radius: 12px; display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; justify-content: center; }
.landing-ajuda-txt { flex: 1 1 260px; max-width: 420px; }
.landing-ajuda-txt h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.landing-ajuda-txt p { margin: 0 0 .6rem; color: var(--muted); }
.landing-ajuda video { width: 100%; max-width: 270px; aspect-ratio: 9 / 16; border-radius: 10px; background: #000; }
.landing-ajuda .selo-validado { display: inline-block; padding: .2rem .6rem; border-radius: 999px; background: #e7f6ec; color: #1b6b3a; font-size: .85rem; font-weight: 600; }
