/* Paleta e estilo extraídos de vagovx.com.br */
:root {
  --background: 222 47% 5%;
  --foreground: 210 20% 92%;
  --card: 222 40% 8%;
  --muted: 222 25% 12%;
  --muted-foreground: 215 12% 55%;
  --border: 222 25% 16%;
  --primary: 90 50% 60%;
  --primary-foreground: 222 47% 5%;
  --glow-green: 90 50% 60%;
  --glow-teal: 180 18% 50%;
  --surface-glass: 222 30% 10%;
  --destructive: 0 84% 60%;

  --light-bg: 210 33% 98%;
  --light-fg: 222 47% 11%;
  --light-muted: 215 16% 47%;
  --light-card: 0 0% 100%;
  --light-border: 214 20% 90%;

  --green: #96CE61;
  --green-dark: #75aa4c;
  --green-hover: #719c49;
  --green-soft: #eef7e8;
  --green-soft-2: #f3f9ee;
  --green-border: #d5ebc4;
  --navy: #355a72;
  --steel: #4f8b9f;
  --teal: #669899;
  --amber: #b7791f;
  --amber-soft: #fdf6e3;
  --red: #dc2626;
  --red-soft: #fef2f2;

  --radius: 1rem;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: hsl(var(--light-bg));
  color: hsl(var(--light-fg));
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--steel); text-decoration: none; }
a:hover { color: var(--navy); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #96ce611a; }
::-webkit-scrollbar-thumb { background: var(--green); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-hover); }

.text-gradient-green {
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  background-image: linear-gradient(135deg, hsl(var(--glow-green)), hsl(90 60% 75%));
}
.gradient-hero {
  background:
    radial-gradient(ellipse 70% 50% at 30% 30%, hsl(var(--glow-green) / 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 75% 25%, hsl(var(--glow-teal) / 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 80%, hsl(var(--glow-teal) / 0.03) 0%, transparent 50%),
    hsl(var(--background));
}
.glow-green { box-shadow: 0 0 40px hsl(var(--glow-green) / 0.18), 0 0 80px hsl(var(--glow-green) / 0.06); }
.glass {
  background: hsl(var(--surface-glass) / .6);
  backdrop-filter: blur(20px);
  border: 1px solid hsl(var(--border) / .5);
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.25rem; border-radius: var(--radius); border: 1px solid transparent;
  font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer;
  transition: transform 250ms cubic-bezier(.16,1,.3,1), background-color 250ms, box-shadow 250ms, border-color 250ms;
  white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--green); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { color: hsl(var(--primary-foreground)); box-shadow: 0 10px 22px hsl(var(--glow-green) / .25), 0 4px 12px hsl(0 0% 0% / .12); }
.btn-outline { background: hsl(var(--light-card)); color: var(--navy); border-color: hsl(var(--light-border)); }
.btn-outline:hover { color: var(--navy); border-color: var(--green); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.btn-danger:hover { color: var(--red); border-color: var(--red); }
.btn-sm { padding: .4rem .75rem; font-size: .8rem; border-radius: .6rem; }
.btn-lg { padding: 1rem 1.75rem; font-size: 1rem; }

/* ---------- Navbar admin (escura, como o topo do site) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: hsl(var(--background) / .92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: .85rem 1rem; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: hsl(var(--foreground)); font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.brand:hover { color: hsl(var(--foreground)); }
.brand-mark {
  width: 34px; height: 34px; border-radius: .7rem; display: grid; place-items: center;
  background: var(--green); color: hsl(var(--primary-foreground));
}
.brand small { display: block; font-weight: 500; font-size: .7rem; color: hsl(var(--muted-foreground)); letter-spacing: 0; }
.nav { display: flex; align-items: center; gap: .25rem; flex: 1; }
.nav a, .nav summary {
  color: hsl(var(--muted-foreground)); font-weight: 600; font-size: .875rem;
  padding: .5rem .8rem; border-radius: .7rem; cursor: pointer; list-style: none;
}
.nav summary::-webkit-details-marker { display: none; }
.nav a:hover, .nav summary:hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); }
.nav a.active, .nav details.active > summary { color: var(--green); background: hsl(var(--glow-green) / .08); }
.nav details { position: relative; }
.nav .dropdown {
  position: absolute; top: calc(100% + .4rem); left: 0; min-width: 210px; padding: .4rem;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  box-shadow: 0 20px 40px hsl(0 0% 0% / .35); display: grid;
}
.nav .dropdown a { display: block; }
.userbox { display: flex; align-items: center; gap: .75rem; font-size: .8rem; color: hsl(var(--muted-foreground)); }
.userbox strong { color: hsl(var(--foreground)); display: block; font-size: .85rem; }
.userbox form { margin: 0; }
.userbox .btn-outline { background: transparent; border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.menu-toggle { display: none; background: none; border: 0; color: hsl(var(--foreground)); padding: .4rem; cursor: pointer; margin-left: auto; }

@media (max-width: 1060px) {
  .menu-toggle { display: block; }
  .topbar-inner { flex-wrap: wrap; }
  .nav, .userbox { display: none; width: 100%; }
  .topbar.open .nav { display: grid; }
  .topbar.open .userbox { display: flex; justify-content: space-between; padding-top: .75rem; border-top: 1px solid hsl(var(--border)); }
  .nav .dropdown { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 1rem; }
}

/* ---------- Faixa de título escura com onda (dark → light) ---------- */
.page-head {
  position: relative; color: hsl(var(--foreground));
  padding: 2.25rem 1rem 4.5rem;
}
.page-head::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 48px;
  background: hsl(var(--light-bg)); clip-path: ellipse(55% 100% at 50% 100%);
}
.page-head-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.page-head h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
.page-head p { margin: .35rem 0 0; color: hsl(var(--muted-foreground)); }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green); margin-bottom: .4rem; }

.container { max-width: 1280px; margin: -1.5rem auto 0; padding: 0 1rem 3rem; position: relative; z-index: 2; }

/* ---------- Cartões ---------- */
.card {
  background: hsl(var(--light-card)); border: 1px solid hsl(var(--light-border));
  border-radius: 1.5rem; padding: 1.5rem; margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px hsl(0 0% 0% / .03);
}
.card-lift { transition: all 400ms ease-out; }
.card-lift:hover { transform: translateY(-3px); box-shadow: 0 12px 40px hsl(var(--glow-green) / .1), 0 4px 16px hsl(0 0% 0% / .05); border-color: hsl(var(--glow-green) / .35); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-title h2 { font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.card-title p { margin: .2rem 0 0; font-size: .85rem; color: hsl(var(--light-muted)); }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: hsl(var(--light-card)); border: 1px solid hsl(var(--light-border)); border-radius: 1.25rem; padding: 1.1rem 1.25rem; }
.stat-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: hsl(var(--light-muted)); }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--navy); letter-spacing: -.02em; margin-top: .2rem; }
.stat-hint { font-size: .8rem; color: hsl(var(--light-muted)); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; margin: 0 -1.5rem; padding: 0 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: hsl(var(--light-muted)); padding: .65rem .75rem; border-bottom: 1px solid hsl(var(--light-border)); white-space: nowrap; }
td { padding: .7rem .75rem; border-bottom: 1px solid hsl(var(--light-border)); vertical-align: middle; }
tbody tr:hover { background: var(--green-soft-2); }
tfoot td { font-weight: 800; color: var(--navy); border-bottom: 0; border-top: 2px solid hsl(var(--light-border)); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: hsl(var(--light-muted)); }
.small { font-size: .8rem; }
.pos { color: var(--green-dark); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }
tr.weekend td { background: hsl(214 20% 97%); }
tr.voided td { text-decoration: line-through; color: hsl(var(--light-muted)); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge-green { background: var(--green-soft); color: var(--green-dark); border-color: var(--green-border); }
.badge-navy { background: #eaf1f5; color: var(--navy); border-color: #d3e1ea; }
.badge-gray { background: hsl(214 20% 95%); color: hsl(var(--light-muted)); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: #f3e2b5; }
.badge-red { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.badge-teal { background: #ecf4f4; color: var(--teal); border-color: #d5e6e6; }

/* ---------- Formulários ---------- */
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: grid; gap: .35rem; }
.field-full { grid-column: 1 / -1; }
label, .label { font-size: .8rem; font-weight: 700; color: var(--navy); }
.hint { font-size: .75rem; color: hsl(var(--light-muted)); font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=month], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: .9rem; color: hsl(var(--light-fg));
  background: hsl(var(--light-card)); border: 1px solid hsl(var(--light-border));
  border-radius: .75rem; padding: .6rem .8rem; transition: border-color 200ms, box-shadow 200ms;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px hsl(var(--glow-green) / .2); }
input:disabled { background: hsl(214 20% 96%); color: hsl(var(--light-muted)); }
.check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .875rem; color: hsl(var(--light-fg)); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green-dark); }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.filters .field { min-width: 160px; flex: 1; }
.filters .field.grow { flex: 2; }

/* ---------- Alertas ---------- */
.alert { padding: .85rem 1rem; border-radius: 1rem; font-size: .875rem; font-weight: 600; margin-bottom: 1rem; border: 1px solid; animation: statusFade .3s ease; }
.alert-success { background: var(--green-soft); color: #4d7a2c; border-color: var(--green-border); }
.alert-error { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.alert-info { background: #eef5f8; color: var(--navy); border-color: #d3e1ea; }
.alert-warn { background: var(--amber-soft); color: var(--amber); border-color: #f3e2b5; }
@keyframes statusFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid hsl(var(--light-border)); margin-bottom: 1.25rem; }
.tabs a { padding: .65rem 1rem; font-weight: 700; font-size: .875rem; color: hsl(var(--light-muted)); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--navy); border-color: var(--green); }

.empty { text-align: center; padding: 2.5rem 1rem; color: hsl(var(--light-muted)); }
.inline-form { display: inline; }
.actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: hsl(var(--light-muted)); }
.dot-green { background: var(--green); box-shadow: 0 0 0 3px hsl(var(--glow-green) / .2); }
.dot-amber { background: #e3a008; }
.dot-red { background: var(--red); }

dialog { border: 0; border-radius: 1.5rem; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 60px hsl(0 0% 0% / .3); }
dialog::backdrop { background: hsl(var(--background) / .6); backdrop-filter: blur(4px); }
dialog .card { margin: 0; border: 0; }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; color: hsl(var(--foreground)); }
.auth-card { width: 100%; max-width: 420px; border-radius: 1.5rem; padding: 2rem; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; margin: 1.25rem 0 .25rem; }
.auth-card p { color: hsl(var(--muted-foreground)); margin: 0 0 1.5rem; font-size: .9rem; }
.auth-card label { color: hsl(var(--foreground)); }
.auth-card input { background: hsl(var(--muted)); border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.auth-card .field { margin-bottom: 1rem; }
.auth-card .btn { width: 100%; margin-top: .5rem; }
.auth-foot { margin-top: 1.5rem; text-align: center; font-size: .8rem; color: hsl(var(--muted-foreground)); }
.auth-foot a, .auth-foot .link { color: var(--green); }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------- Impressão (relatórios) ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .topbar, .page-head, .no-print, .filters, .tabs, .form-actions, .actions { display: none !important; }
  .print-only { display: block; }
  .container { margin: 0; padding: 0; max-width: none; }
  .card { border: 0; padding: 0; margin-bottom: 14px; box-shadow: none; break-inside: avoid-page; }
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  th, td { padding: 4px 6px; }
  tbody tr:hover { background: none; }
  .print-header { display: flex; justify-content: space-between; border-bottom: 2px solid var(--navy); padding-bottom: 8px; margin-bottom: 12px; }
  .print-header h1 { font-size: 16px; color: var(--navy); }
  .signatures { display: flex !important; gap: 40px; margin-top: 40px; }
  .signatures div { flex: 1; border-top: 1px solid #333; padding-top: 4px; text-align: center; }
  .page-break { break-after: page; }
}
.signatures { display: none; }
