:root {
  --bg: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --line: #e2e8f0;
  --card: #ffffff;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
.font-display { font-family: var(--font-display); }

.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.btn {
  display: inline-flex; align-items: center; justify-center; gap: .5rem;
  height: 2.75rem; padding: 0 1.25rem; border-radius: .75rem;
  border: 1px solid transparent; font-weight: 600; font-size: .9rem;
  cursor: pointer; transition: .15s ease;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-outline { background: #fff; border-color: #cbd5e1; color: var(--ink); }
.btn-outline:hover { background: #f8fafc; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.input, select {
  width: 100%; height: 2.75rem; border: 1px solid #cbd5e1; border-radius: .75rem;
  padding: 0 .85rem; font: inherit; background: #fff;
}
.input:focus, select:focus { outline: 2px solid rgba(15,118,110,.25); border-color: var(--teal); }
.label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; color: #334155; }
.field { margin-bottom: 1rem; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-6 { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid-6 { grid-template-columns: repeat(6, 1fr); } }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
@media (max-width: 719px) { .span-2,.span-3,.span-4,.span-6 { grid-column: span 1; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 1.5rem;
  padding: 1.5rem; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

.hero {
  min-height: 100svh; position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse at top left, #ccfbf1 0%, transparent 45%),
    radial-gradient(ellipse at bottom right, #dbeafe 0%, transparent 40%),
    linear-gradient(180deg, #f8fafc 0%, #eef6f4 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image:
    linear-gradient(rgba(15,23,42,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.nav { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 0; gap: 1rem; }
.brand { font-family: var(--font-display); font-size: 1.5rem; }
.brand span { color: var(--teal); }
.nav-links { display: none; gap: 1.5rem; color: #475569; font-size: .9rem; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.hero-grid {
  position: relative; display: grid; gap: 2.5rem; align-items: center;
  padding: 3rem 0 4rem;
}
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.1fr .9fr; } }
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.7); border: 1px solid #99f6e4; color: #115e59;
  border-radius: 999px; padding: .35rem .75rem; font-size: .75rem; font-weight: 600;
}
.hero h1 { font-family: var(--font-display); font-size: clamp(2.8rem, 8vw, 3.75rem); margin: 1rem 0 .75rem; line-height: 1.05; }
.hero p.lead { color: #475569; font-size: 1.1rem; max-width: 28rem; line-height: 1.6; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.panel {
  background: #0f172a; color: #fff; border-radius: 1.75rem; overflow: hidden;
  border: 1px solid rgba(255,255,255,.08); box-shadow: 0 25px 50px rgba(15,23,42,.2);
  animation: floaty 6s ease-in-out infinite;
}
.panel-h { padding: .85rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.1); font-size: .75rem; color: #cbd5e1; }
.panel-b { padding: 1.1rem; display: grid; gap: .65rem; }
.panel-row {
  display: flex; justify-content: space-between; gap: 1rem;
  background: rgba(255,255,255,.05); border-radius: .85rem; padding: .85rem 1rem; font-size: .875rem;
}
.panel-row span:last-child { color: #94a3b8; }

.section { padding: 5rem 0; }
.section.alt { background: #f1f5f9; border-block: 1px solid var(--line); }
.kicker { color: var(--teal); font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.section h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.4rem); margin: .6rem 0; }
.muted { color: var(--muted); }
.mod-grid { display: grid; gap: 2rem; margin-top: 2.5rem; }
@media (min-width: 768px) { .mod-grid { grid-template-columns: 1fr 1fr; } }
.mod { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.mod h3 { font-family: var(--font-display); font-size: 1.5rem; margin: 0; }
.mod ul { padding: 0; margin: 1rem 0 0; list-style: none; }
.mod li { display: flex; gap: .6rem; color: #475569; font-size: .925rem; margin-bottom: .55rem; }
.mod li::before { content: ""; width: .4rem; height: .4rem; margin-top: .55rem; border-radius: 999px; background: var(--teal); flex: none; }

.flow-pre {
  background: #fff; border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem;
  overflow: auto; font-family: ui-monospace, monospace; font-size: .72rem; color: #334155; line-height: 1.5;
}
.steps { display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(5, 1fr); } }
.steps h4 { margin: .35rem 0; }
.phases { display: grid; gap: 2rem; margin-top: 2.5rem; }
@media (min-width: 768px) { .phases { grid-template-columns: repeat(3, 1fr); } }
.phases li { border-left: 2px solid rgba(15,118,110,.4); padding-left: .75rem; margin-bottom: .75rem; color: #475569; font-size: .9rem; }

.cta-band { background: #0f172a; color: #fff; padding: 4rem 0; position: relative; overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(45,212,191,.25), transparent 40%);
}
.footer { border-top: 1px solid var(--line); background: #fff; padding: 2rem 0; color: #64748b; font-size: .875rem; }

.page { min-height: 100svh; background: linear-gradient(180deg, #f8fafc, #eef7f5); padding: 2rem 0 3rem; }
.progress { height: .5rem; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: .75rem 0 1rem; }
.progress > span { display: block; height: 100%; background: var(--teal); transition: width .4s ease; }
.steps-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; text-align: center; font-size: .75rem; color: #94a3b8; margin-bottom: 1.5rem; }
.steps-mini .on { color: #115e59; font-weight: 600; }
.alert { padding: .85rem 1rem; border-radius: .85rem; background: #f0fdfa; border: 1px solid #99f6e4; color: #134e4a; font-size: .9rem; margin-bottom: 1rem; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.face-box {
  position: relative; aspect-ratio: 4/3; border-radius: 1rem; overflow: hidden;
  background: #0f172a; border: 1px solid var(--line);
}
.face-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-ring {
  pointer-events: none; position: absolute; inset: 0; display: grid; place-items: center;
}
.face-ring::after {
  content: ""; width: 10rem; height: 10rem; border-radius: 999px;
  border: 2px solid rgba(94,234,212,.85);
  box-shadow: 0 0 0 999px rgba(15,23,42,.35);
}
.dash-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .dash-grid { grid-template-columns: repeat(3, 1fr); } }
.dash-card { background: #fff; border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem; transition: .15s; }
.dash-card:hover { border-color: #5eead4; box-shadow: 0 8px 20px rgba(15,23,42,.05); }
.stats { display: grid; gap: 1rem; margin: 1.5rem 0; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 1rem; padding: 1rem 1.15rem; }
.stat small { color: #64748b; }
.row-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.75rem; }
.hidden { display: none !important; }
.toast {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: .7rem 1rem; border-radius: .75rem;
  font-size: .875rem; z-index: 50; opacity: 0; pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Módulo Folha */
.folha-shell { min-height: 100svh; background: #f8fafc; }
.folha-top {
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.folha-top .inner {
  display: flex; flex-wrap: wrap; gap: .75rem 1.25rem;
  align-items: center; justify-content: space-between;
  padding: .85rem 0;
}
.folha-nav {
  display: flex; flex-wrap: wrap; gap: .35rem;
}
.folha-nav a {
  padding: .45rem .8rem; border-radius: .65rem; font-size: .85rem;
  color: #475569; font-weight: 500;
}
.folha-nav a:hover { background: #f1f5f9; color: #0f172a; }
.folha-nav a.on { background: #ccfbf1; color: #115e59; font-weight: 700; }
.folha-hero {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: flex-end; justify-content: space-between;
  margin: 1.5rem 0 1.25rem;
}
.folha-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.folha-tile {
  background: #fff; border: 1px solid var(--line); border-radius: 1rem;
  padding: 1.15rem; transition: .15s; display: block;
}
.folha-tile:hover { border-color: #5eead4; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
.folha-tile h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.folha-tile p { margin: 0; color: #64748b; font-size: .85rem; line-height: 1.45; }
.folha-tile .go { display: inline-block; margin-top: .85rem; color: var(--teal); font-size: .8rem; font-weight: 700; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 1rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: .75rem 1rem; border-bottom: 1px solid #e2e8f0; text-align: left; white-space: nowrap; }
table.data th { background: #f8fafc; color: #475569; font-weight: 600; font-size: .8rem; }
table.data tr:last-child td { border-bottom: 0; }
table.data a { color: var(--teal); font-weight: 600; }
.badge-soft {
  display: inline-block; padding: .2rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; background: #f1f5f9; color: #334155;
}
.badge-ok { background: #ccfbf1; color: #115e59; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-err { background: #fee2e2; color: #991b1b; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.split { display: grid; gap: 1rem; }
@media (min-width: 900px) { .split-2 { grid-template-columns: 1.2fr .8fr; } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 1rem; padding: 1rem 1.15rem; }
.kpi strong { display: block; font-size: 1.25rem; margin-top: .25rem; }
.holerite-box { background: #fff; border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem; }
.holerite-box .line { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed #e2e8f0; font-size: .9rem; }
.holerite-box .line:last-child { border-bottom: 0; font-weight: 700; }
