:root {
  --bg: #06080c;
  --bg-soft: #0b0f16;
  --bg-card: #0f1520;
  --bg-card-2: #141c2b;
  --border: #1f2b3d;
  --border-2: #2a3850;
  --text: #e8eef7;
  --text-dim: #9fb0c8;
  --neon: #39ff8a;
  --neon-2: #22e0c8;
  --cta: #00e5a0;
  --cta-hover: #27f9b6;
  --danger: #ff5c5c;
  --warn: #ffcf5c;
  --info: #4cc3ff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0,229,160,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0,224,192,.06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4 { line-height: 1.15; margin: 0 0 .5rem; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
a { color: var(--neon-2); }
p { margin: .4rem 0; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.container-wide { max-width: 1440px; }

/* Campos e botões */
button, .btn {
  cursor: pointer;
  min-height: 48px;
  padding: .7rem 1.2rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 1rem;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  background: transparent;
  color: var(--text);
}
button:hover, .btn:hover { filter: brightness(1.06); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--neon-2);
  outline-offset: 2px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--cta), #0ccf9a);
  color: #03110b;
  box-shadow: 0 6px 22px rgba(0,229,160,.28);
}
.btn-primary:hover { background: linear-gradient(135deg, #19ffb4, #0adca0); }
.btn-ghost { border-color: var(--border-2); color: var(--text); background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: var(--neon-2); color: var(--neon-2); }
.btn-danger { border-color: rgba(255,92,92,.6); color: var(--danger); }
.btn-danger:hover { background: rgba(255,92,92,.12); }
.btn-sm { min-height: 38px; padding: .35rem .8rem; font-size: .9rem; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  width: 100%;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: .8rem .9rem;
  font-size: 1rem;
  min-height: 48px;
}
input:focus, select:focus, textarea:focus { border-color: var(--neon-2); }
label { display: block; margin: .6rem 0 .35rem; color: var(--text-dim); font-weight: 600; font-size: .9rem; }
.small { font-size: .82rem; color: var(--text-dim); }
.dim { color: var(--text-dim); }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card h3 { color: var(--neon); letter-spacing: .02em; }

/* Grids */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* KPI cards */
.kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.kpi .kpi-value { font-size: 1.9rem; font-weight: 800; color: var(--neon); font-family: var(--mono); }
.kpi .kpi-label { color: var(--text-dim); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-top: .3rem; }

/* Badges / estados */
.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge-ok { background: rgba(57,255,138,.15); color: #59ffb0; }
.badge-warn { background: rgba(255,207,92,.15); color: #ffd975; }
.badge-block { background: rgba(255,92,92,.15); color: #ff8f8f; }
.badge-info { background: rgba(76,195,255,.14); color: #7cd6ff; }
.badge-dim { background: rgba(159,176,200,.12); color: var(--text-dim); }
.badge-pending { background: rgba(255,127,0,.15); color: #ffa64d; }

/* Alertas / mensagens */
.alert { border-radius: 12px; padding: .9rem 1rem; margin: .6rem 0; border: 1px solid; font-weight: 500; }
.alert-error { border-color: rgba(255,92,92,.5); background: rgba(255,92,92,.08); color: #ffb3b3; }
.alert-success { border-color: rgba(57,255,138,.5); background: rgba(57,255,138,.08); color: #b6ffe6; }
.alert-info { border-color: rgba(76,195,255,.45); background: rgba(76,195,255,.08); color: #cbe9ff; }
.alert-warn { border-color: rgba(255,207,92,.5); background: rgba(255,207,92,.08); color: #ffe9b0; }

/* Estados de dados */
.state { padding: 3rem 1rem; text-align: center; color: var(--text-dim); }
.state .spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border-2); border-top-color: var(--neon);
  margin: 0 auto 1rem; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Nav topo */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6,8,12,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.navbar .inner { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 900; font-size: 1.25rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #00e5a0, #00b3ff); display: grid; place-items: center; font-size: 1.1rem; color: #02120c; }
.nav-links { display: flex; gap: 1rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-weight: 600; font-size: .92rem; }
.nav-links a:hover { color: var(--neon); }
.nav-links a:hover, .nav-links a.active { color: var(--neon); }

/* Tabelas */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; padding: .7rem .9rem; color: var(--text-dim); text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
td { padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

/* Chips de horário */
.timechip { display: inline-block; padding: .55rem .9rem; margin: .25rem; border-radius: 10px; border: 1px solid var(--border-2); cursor: pointer; font-weight: 600; font-family: var(--mono); }
.timechip:hover { border-color: var(--neon-2); }
.timechip[aria-disabled="true"], .timechip:disabled { opacity: .42; cursor: not-allowed; text-decoration: line-through; }
.timechip.selected { background: var(--cta); color: #04140c; border-color: var(--cta); }

/* Wizard progress */
.steps { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.step { display: flex; align-items: center; gap: .5rem; color: var(--text-dim); font-size: .82rem; }
.step .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-2); display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.step.done .dot { background: var(--cta); color: #04140c; border-color: var(--cta); }
.step.active { color: var(--text); }
.step.active .dot { border-color: var(--neon-2); color: var(--neon-2); }

.segmented { display: flex; border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-radius: 0; background: transparent; color: var(--text-dim); min-height: 46px; }
.seg button[aria-pressed="true"] { background: var(--cta); color: #04140c; }

.divider { border-top: 1px dashed var(--border-2); margin: 1.2rem 0; }

.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.mt1 { margin-top: 1rem; } .mt2 { margin-top: 2rem; } .mb2 { margin-bottom: 2rem; }
.text-neon { color: var(--neon); }
.text-neon2 { color: var(--neon-2); }
.mono { font-family: var(--mono); }

footer.site { border-top: 1px solid var(--border); padding: 2rem 0 2.4rem; margin-top: 4rem; color: var(--text-dim); }
footer.site .inner { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; }

/* Acessibilidade: reduz movimento */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Responsivo */
@media (max-width: 720px) {
  .navbar .inner { gap: .6rem; }
  .nav-links { margin-left: 0; width: 100%; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  td, th { padding: .55rem .6rem; }
}
@media (max-width: 480px) {
  .grid-kpi { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
/* Badge de não lidas no nav */
.nav-notif { position: relative; }
.nav-badge {
  position: absolute; top: -6px; right: -10px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--neon, #00e5ff);
  color: #05121a; font-size: .68rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
/* Timeline de histórico no portal do cliente */
.timeline {
  list-style: none; margin: .75rem 0 0; padding-left: 0;
  border-left: 2px solid rgba(0, 229, 255, .35); margin-left: .35rem;
}
.timeline li {
  position: relative; padding: .35rem 0 .35rem 1.1rem;
}
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: .7rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--neon, #00e5ff);
}

