/* ============================================================
   STINTON — Design System v3 "MOLTEN"
   Formas fluidas e arredondadas, degradês vermelho→preto,
   bordas de luz em rotação e movimento contínuo e sutil.
   ============================================================ */

@property --spin {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --bg: #08060a;
  --bg-raised: #0e0a10;
  --surface: #131017;
  --surface-elevated: #17131d;
  --border: #262130;
  --border-hot: rgba(255, 61, 61, 0.45);
  --muted: #1b1622;
  --muted-foreground: #98909f;
  --foreground: #f2eff5;

  --blood: #b31212;
  --blood-bright: #ff3d3d;
  --blood-deep: #420000;
  --blood-dim: rgba(255, 61, 61, 0.12);
  --destructive: #ff3d3d;
  --focus-ring: #ff3d3d;

  --ok: #2fe08b;
  --warn: #ffb020;
  --info: #4fb3ff;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --gradient-blood: linear-gradient(135deg, #ff4d4d 0%, #e01414 45%, #6e0202 100%);
  --gradient-card: linear-gradient(160deg, rgba(255, 61, 61, 0.055) 0%, rgba(19, 16, 23, 0) 38%), linear-gradient(180deg, #151119 0%, #0d0a11 100%);
  --glow: 0 10px 30px -12px rgba(255, 61, 61, 0.55);
  --glow-strong: 0 0 40px -8px rgba(255, 61, 61, 0.5), 0 24px 80px -24px rgba(179, 18, 18, 0.7);

  --font-display: "Outfit", "Space Grotesk", system-ui, sans-serif;
  --font-ui: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --sidebar-w: 268px;
  --header-h: 68px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--foreground);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  position: relative;
  min-height: 100vh;
}

::selection { background: rgba(255, 61, 61, 0.35); color: #fff; }

/* ---- fundo vivo: orbes de lava derretida à deriva ---- */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(70px);
}
body::before {
  width: 60vw; height: 60vw;
  top: -28vw; left: -18vw;
  background: radial-gradient(circle at 35% 35%, rgba(224, 20, 20, 0.22), rgba(110, 2, 2, 0.10) 45%, transparent 70%);
  animation: orb-drift-a 26s ease-in-out infinite alternate;
}
body::after {
  width: 52vw; height: 52vw;
  bottom: -26vw; right: -16vw;
  background: radial-gradient(circle at 60% 60%, rgba(255, 77, 77, 0.13), rgba(66, 0, 0, 0.16) 50%, transparent 72%);
  animation: orb-drift-b 32s ease-in-out infinite alternate;
}
@keyframes orb-drift-a {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(9vw, 7vh) scale(1.15); }
}
@keyframes orb-drift-b {
  0%   { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(-8vw, -6vh) scale(0.95); }
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff4d4d, #6e0202);
  border-radius: 99px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--blood-bright); }

/* ============ Tipografia ============ */
h1, h2, h3, .h-title {
  font-family: var(--font-display);
  text-wrap: balance;
}
.h-title { font-weight: 700; letter-spacing: -0.015em; line-height: 1.12; }
.h-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.67rem;
  color: var(--muted-foreground);
}
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--muted-foreground); }
.text-blood { color: var(--blood-bright); }

.brand-gradient {
  background: linear-gradient(115deg, #ffffff 15%, #ffc2c2 45%, #ff4d4d 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ Shell ============ */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(200deg, rgba(179, 18, 18, 0.14) 0%, rgba(179, 18, 18, 0.02) 30%, rgba(179, 18, 18, 0) 100%), #0a070c;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-brand { padding: 24px 22px 20px; }
.sidebar-brand .mark { display: flex; align-items: center; gap: 12px; }
.logo-mark { filter: drop-shadow(0 6px 18px rgba(224, 20, 20, 0.45)); flex-shrink: 0; }
.sidebar-brand .mark-text {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 1.3rem;
  line-height: 1;
}
.sidebar-brand .mark-sub {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.sidebar-nav { flex: 1; padding: 10px 14px; overflow-y: auto; }
.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  margin-bottom: 6px;
  border-radius: 999px;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 0.87rem;
  font-weight: 500;
  position: relative;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.sidebar-nav .nav-item:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.045);
  transform: translateX(3px);
}
.sidebar-nav .nav-item.active {
  color: #fff;
  background: linear-gradient(120deg, rgba(224, 20, 20, 0.85), rgba(110, 2, 2, 0.55));
  box-shadow: 0 8px 24px -10px rgba(224, 20, 20, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.sidebar-nav .nav-item .icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-nav .nav-section-label { padding: 14px 14px 6px; }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.role-switch { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: var(--header-h);
  background: rgba(8, 6, 10, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  overflow: hidden;
}
.topbar::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0;
  height: 1px; width: 180px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--blood-bright), transparent);
  animation: laser-run 8s ease-in-out infinite;
}
@keyframes laser-run {
  0%   { transform: translateX(-200px); }
  100% { transform: translateX(calc(100vw + 200px)); }
}
.topbar .page-title { font-size: 1.05rem; }
.topbar .page-crumb {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--muted-foreground);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.menu-toggle { display: none; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-content { padding: 30px 34px; flex: 1; }

/* ============ Hero panel (dashboard) ============ */
.hero-panel {
  position: relative;
  border-radius: var(--r-xl);
  padding: 1px;
  margin-bottom: 24px;
  background: conic-gradient(from var(--spin), rgba(255, 61, 61, 0) 0%, rgba(255, 61, 61, 0.7) 12%, rgba(255, 120, 60, 0.35) 22%, rgba(255, 61, 61, 0) 38%, rgba(255, 61, 61, 0) 60%, rgba(255, 61, 61, 0.35) 78%, rgba(255, 61, 61, 0) 92%), var(--border);
  animation: spin-border 7s linear infinite;
}
@keyframes spin-border { to { --spin: 360deg; } }
.hero-panel-inner {
  border-radius: calc(var(--r-xl) - 1px);
  padding: 30px 34px;
  background:
    radial-gradient(ellipse 70% 130% at 92% -20%, rgba(224, 20, 20, 0.35), transparent 60%),
    radial-gradient(ellipse 40% 90% at 5% 110%, rgba(110, 2, 2, 0.35), transparent 65%),
    linear-gradient(160deg, #17101a 0%, #0c080f 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  overflow: hidden;
  position: relative;
}
.hero-panel-inner::after {
  content: "";
  position: absolute;
  top: -60%; right: -10%;
  width: 45%; height: 220%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.045), transparent);
  transform: rotate(12deg);
  animation: hero-sheen 6.5s ease-in-out infinite;
}
@keyframes hero-sheen {
  0%, 60%, 100% { transform: translateX(0) rotate(12deg); }
  30%           { transform: translateX(-140%) rotate(12deg); }
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--blood-bright);
  margin-bottom: 8px;
}
.hero-title {
  font-size: 2rem;
  margin: 0 0 6px;
  font-weight: 800;
  background: linear-gradient(115deg, #fff 30%, #ffb8b8 70%, #ff6a6a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { margin: 0; color: var(--muted-foreground); font-size: 0.92rem; }
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.hero-date { font-size: 0.7rem; color: var(--muted-foreground); }
.live-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 61, 61, 0.14);
  border: 1px solid rgba(255, 61, 61, 0.4);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blood-bright);
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 61, 61, 0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 61, 61, 0); }
}

/* ============ Botões ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 0.78rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-blood);
  color: #fff;
  box-shadow: 0 8px 22px -10px rgba(224, 20, 20, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 32px -10px rgba(255, 61, 61, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25); transform: translateY(-2px); }
.btn-primary:hover:not(:disabled)::after { left: 125%; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border);
  color: var(--foreground);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--border-hot); color: #fff; background: var(--blood-dim); }

.btn-ghost { background: transparent; color: var(--muted-foreground); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { color: var(--foreground); background: var(--muted); }

.btn-danger { background: transparent; border-color: rgba(255, 61, 61, 0.5); color: var(--destructive); }
.btn-danger:hover:not(:disabled) { background: var(--blood-dim); box-shadow: 0 8px 22px -12px rgba(255, 61, 61, 0.7); }

.btn-sm { padding: 6px 14px; font-size: 0.68rem; }
.btn-icon { padding: 8px; }
.btn-block { width: 100%; }

/* ============ Cards ============ */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card-elevated {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.card-hover { transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; cursor: pointer; }
.card-hover:hover { border-color: var(--border-hot); box-shadow: var(--glow); transform: translateY(-3px); }

/* ============ Inputs ============ */
label.field-label {
  display: block;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.62rem;
  color: var(--muted-foreground);
  margin-bottom: 7px;
}
.input, .textarea, select.input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--foreground);
  padding: 11px 14px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.textarea { resize: vertical; min-height: 90px; border-radius: var(--r-md); }
.input:focus, .textarea:focus, select.input:focus {
  border-color: var(--focus-ring);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 61, 61, 0.13);
}
.field { margin-bottom: 16px; }
.field-hint { font-size: 0.72rem; color: var(--muted-foreground); margin-top: 5px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input[type="checkbox"], .checkbox-row input[type="radio"] { accent-color: var(--blood-bright); width: 16px; height: 16px; flex-shrink: 0; }
.checkbox-row input.input { flex: 1; width: auto; }

/* ============ Badges / Status ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-foreground);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-nao_iniciado { color: #8f8f9c; border-color: #37323f; }
.badge-em_andamento { color: var(--warn); border-color: rgba(255, 176, 32, 0.4); background: rgba(255, 176, 32, 0.09); }
.badge-aguardando_avaliacao { color: var(--info); border-color: rgba(79, 179, 255, 0.4); background: rgba(79, 179, 255, 0.09); }
.badge-aprovado_call { color: var(--ok); border-color: rgba(47, 224, 139, 0.4); background: rgba(47, 224, 139, 0.09); }
.badge-reprovado { color: var(--blood-bright); border-color: var(--border-hot); background: var(--blood-dim); }

.badge-concluida { color: var(--ok); border-color: rgba(47, 224, 139, 0.4); background: rgba(47, 224, 139, 0.09); }
.badge-pendente { color: var(--muted-foreground); }
.badge-bloqueada { color: #595966; }
.badge-aguardando { color: var(--info); border-color: rgba(79, 179, 255, 0.4); background: rgba(79, 179, 255, 0.09); }

/* ============ Progresso ============ */
.progress-track {
  height: 9px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6e0202, #e01414 45%, #ff6a4d 90%);
  background-size: 200% 100%;
  box-shadow: 0 0 16px -2px rgba(255, 61, 61, 0.8);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  animation: flow-gradient 3s ease-in-out infinite alternate;
}
@keyframes flow-gradient {
  0%   { background-position: 0% 0; }
  100% { background-position: 100% 0; }
}
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-pct { font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* anel circular */
.ring {
  --pct: 0;
  width: 124px; height: 124px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(#ff4d4d calc(var(--pct) * 1%), rgba(255, 255, 255, 0.07) 0);
  position: relative;
  filter: drop-shadow(0 10px 26px rgba(224, 20, 20, 0.35));
}
.ring::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 61, 61, 0.3);
  animation: ring-spin 26s linear infinite;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
.ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1c141f, #0e0a11 70%);
}
.ring-value {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

/* ============ KPI ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  position: relative;
  border-radius: var(--r-lg);
  padding: 22px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
/* borda de luz girando */
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--spin), transparent 0%, rgba(255, 61, 61, 0.85) 10%, rgba(255, 130, 70, 0.4) 18%, transparent 32%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin-border 6s linear infinite;
  opacity: 0.75;
  pointer-events: none;
}
.kpi-card:nth-child(2)::before { animation-delay: -1.5s; }
.kpi-card:nth-child(3)::before { animation-delay: -3s; }
.kpi-card:nth-child(4)::before { animation-delay: -4.5s; }
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--glow); border-color: var(--border-hot); }
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: linear-gradient(140deg, rgba(255, 61, 61, 0.22), rgba(110, 2, 2, 0.28));
  border: 1px solid rgba(255, 61, 61, 0.3);
  color: #ff8f8f;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.kpi-icon svg { width: 21px; height: 21px; }
.kpi-ok .kpi-icon { background: linear-gradient(140deg, rgba(47, 224, 139, 0.18), rgba(10, 60, 36, 0.3)); border-color: rgba(47, 224, 139, 0.32); color: #7defb8; }
.kpi-value {
  font-size: 2.3rem;
  font-weight: 800;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: linear-gradient(120deg, #fff 30%, #ffd2d2 75%, #ff8a8a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kpi-value.text-blood { background: linear-gradient(120deg, #ff8a8a, #ff3d3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi-label { margin-top: 10px; }

/* barras de status (dashboard) */
.status-row { display: flex; align-items: center; gap: 12px; }
.status-row .badge { flex-shrink: 0; min-width: 172px; }
.status-bar {
  flex: 1;
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.status-bar-fill {
  height: 100%;
  border-radius: 99px;
  min-width: 0;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.status-fill-nao_iniciado { background: linear-gradient(90deg, #3a3a46, #6b6b78); }
.status-fill-em_andamento { background: linear-gradient(90deg, #8a5800, var(--warn)); }
.status-fill-aguardando_avaliacao { background: linear-gradient(90deg, #14476b, var(--info)); }
.status-fill-aprovado_call { background: linear-gradient(90deg, #0c5c38, var(--ok)); }
.status-fill-reprovado { background: linear-gradient(90deg, #6e0202, var(--blood-bright)); }
.status-count { font-weight: 700; min-width: 20px; text-align: right; font-variant-numeric: tabular-nums; }

/* ============ Grid helpers ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-gap { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ============ Section header ============ */
.section-header { margin-bottom: 22px; }
.section-header h1 {
  font-size: 1.65rem;
  margin: 0 0 4px;
  font-weight: 800;
  background: linear-gradient(115deg, #fff 35%, #ffc9c9 75%, #ff7a7a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}
.section-header p { margin: 0; color: var(--muted-foreground); font-size: 0.9rem; }

/* ============ Tabela ============ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.62rem;
  color: var(--muted-foreground);
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(255, 61, 61, 0.07), rgba(14, 10, 16, 0.6));
  border-bottom: 1px solid var(--border);
}
table.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(19, 16, 23, 0.55);
  transition: background 0.15s ease;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr.clickable:hover td { background: rgba(255, 61, 61, 0.06); cursor: pointer; }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 2, 6, 0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fade-in 0.18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: linear-gradient(170deg, #191322 0%, #100c15 100%);
  border: 1px solid rgba(255, 61, 61, 0.25);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--glow-strong);
  animation: modal-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modal-rise { from { transform: translateY(22px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-box.modal-lg { max-width: 780px; }
.modal-header {
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0;
  background: rgba(25, 19, 34, 0.9);
  backdrop-filter: blur(8px);
  z-index: 2;
}
.modal-body { padding: 26px; }
.modal-footer {
  padding: 16px 26px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0;
  background: rgba(25, 19, 34, 0.9);
  backdrop-filter: blur(8px);
}
.modal-close { cursor: pointer; color: var(--muted-foreground); font-size: 1.2rem; background: none; border: none; border-radius: 50%; width: 34px; height: 34px; transition: color 0.18s ease, background 0.18s ease, transform 0.25s ease; }
.modal-close:hover { color: #fff; background: var(--blood-dim); transform: rotate(90deg); }

/* ============ Slide-over ============ */
.slideover-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 2, 6, 0.62);
  z-index: 90;
  display: flex; justify-content: flex-end;
  animation: fade-in 0.18s ease;
}
.slideover-panel {
  width: min(540px, 100%);
  height: 100%;
  background: linear-gradient(200deg, #181221 0%, #0e0a12 100%);
  border-left: 1px solid rgba(255, 61, 61, 0.28);
  border-radius: var(--r-xl) 0 0 var(--r-xl);
  box-shadow: -30px 0 90px -30px rgba(224, 20, 20, 0.4);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slideIn { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.slideover-header {
  padding: 24px 26px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(24, 18, 33, 0.92);
  backdrop-filter: blur(8px);
  border-radius: var(--r-xl) 0 0 0;
  z-index: 2;
}
.slideover-body { padding: 26px; overflow-y: auto; flex: 1; }
.slideover-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-wrap: wrap;
}

/* ============ Trilha do vendedor ============ */
.day-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--gradient-card);
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease;
}
.day-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #ff4d4d, #6e0202 80%);
  opacity: 0.85;
}
.day-card.locked::before { background: linear-gradient(180deg, #3a3a46, transparent 80%); }
.day-card-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255, 61, 61, 0.05), transparent 55%);
}
.day-card.locked .day-card-head { opacity: 0.55; }
.day-card-head .day-num {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--blood-bright);
}
.day-card-body { padding: 10px; }

.etapa-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.etapa-row:hover { background: rgba(255, 61, 61, 0.06); transform: translateX(4px); }
.etapa-row.locked { opacity: 0.45; cursor: not-allowed; }
.etapa-row.locked:hover { background: transparent; transform: none; }
.etapa-row .etapa-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border);
  flex-shrink: 0; font-size: 0.85rem;
  transition: transform 0.18s ease;
}
.etapa-row:hover .etapa-icon { transform: scale(1.08); }
.etapa-row.concluida .etapa-icon { background: rgba(47, 224, 139, 0.13); border-color: rgba(47, 224, 139, 0.45); color: var(--ok); }
.etapa-row.aguardando .etapa-icon { background: rgba(79, 179, 255, 0.13); border-color: rgba(79, 179, 255, 0.45); color: var(--info); }
.etapa-row .etapa-title { flex: 1; font-size: 0.87rem; font-weight: 500; }
.etapa-row .etapa-meta { font-family: var(--font-mono); font-size: 0.62rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.1em; }

/* ============ Builder ============ */
.builder-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  align-items: start;
}
.builder-day {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.builder-day-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255, 61, 61, 0.07), transparent 60%);
}
.builder-etapa-list { padding: 10px; min-height: 40px; }
.builder-etapa {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 13px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.builder-etapa:hover { border-color: var(--border-hot); background: rgba(255, 61, 61, 0.05); transform: translateX(2px); }
.builder-etapa.dragging { opacity: 0.4; }
.builder-etapa-top { display: flex; align-items: center; gap: 8px; }
.builder-etapa .drag-handle { color: var(--muted-foreground); cursor: grab; flex-shrink: 0; }
.builder-etapa .etapa-type-tag {
  font-family: var(--font-mono); font-size: 0.58rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: #ff9e9e; background: var(--blood-dim);
  border: 1px solid rgba(255, 61, 61, 0.3); padding: 3px 9px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.builder-etapa .etapa-name { font-size: 0.82rem; line-height: 1.4; }
.builder-etapa-actions { display: flex; gap: 2px; margin-left: auto; flex-shrink: 0; }
.builder-etapa-actions button { background: none; border: none; color: var(--muted-foreground); cursor: pointer; padding: 4px 7px; border-radius: 8px; font-size: 0.85rem; transition: color 0.15s ease, background 0.15s ease; }
.builder-etapa-actions button:hover { color: var(--blood-bright); background: var(--blood-dim); }
.drop-placeholder { height: 4px; border-radius: 99px; background: var(--gradient-blood); margin: 4px 0; box-shadow: var(--glow); }

/* ============ Quiz ============ */
.quiz-question { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.quiz-question:last-child { border-bottom: none; }
.quiz-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-md);
  margin-bottom: 8px; cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.quiz-option:hover { border-color: var(--border-hot); transform: translateX(4px); }
.quiz-option.selected { border-color: var(--blood-bright); background: var(--blood-dim); }
.quiz-option.correct { border-color: var(--ok); background: rgba(47, 224, 139, 0.1); }
.quiz-option.incorrect { border-color: var(--destructive); background: var(--blood-dim); }
.quiz-option input { accent-color: var(--blood-bright); }

/* ============ Login ============ */
.login-screen {
  width: 100%;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  padding: 24px;
  overflow: hidden;
}
.login-screen::before {
  content: "";
  position: absolute;
  width: min(700px, 95vw); height: min(700px, 95vw);
  border-radius: 50%;
  border: 1px dashed rgba(255, 61, 61, 0.14);
  animation: ring-spin 70s linear infinite;
  pointer-events: none;
}
.login-screen::after {
  content: "";
  position: absolute;
  width: min(520px, 72vw); height: min(520px, 72vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 20, 20, 0.09), transparent 65%);
  pointer-events: none;
}
.login-box { width: 100%; max-width: 430px; text-align: center; position: relative; z-index: 1; }
.login-logo { margin-bottom: 30px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.login-logo .logo-mark { animation: logo-float 5s ease-in-out infinite; margin-bottom: 12px; }
@keyframes logo-float {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 10px 26px rgba(224, 20, 20, 0.5)); }
  50%      { transform: translateY(-8px); filter: drop-shadow(0 22px 34px rgba(224, 20, 20, 0.65)); }
}
.login-logo h1 { font-size: 2.3rem; margin: 0 0 4px; font-weight: 800; letter-spacing: -0.01em; }
.login-box .card { text-align: left; padding: 28px; border-radius: var(--r-xl); border-color: rgba(255, 61, 61, 0.22); box-shadow: 0 30px 90px -30px rgba(224, 20, 20, 0.35); }

.role-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.role-card:hover { border-color: var(--border-hot); box-shadow: var(--glow); transform: translateY(-2px); }
.role-card h3 { margin: 0 0 4px; font-size: 1rem; }
.role-card p { margin: 0; color: var(--muted-foreground); font-size: 0.82rem; }
.vendedor-pick-list { margin-top: 10px; display: none; flex-direction: column; gap: 8px; }
.vendedor-pick-list.open { display: flex; }
.vendedor-pick-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--muted); cursor: pointer;
}
.vendedor-pick-item:hover { border-color: var(--blood-bright); }

/* ============ Avatar ============ */
.avatar {
  width: 38px; height: 38px;
  border-radius: 38%;
  background: var(--gradient-blood);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 16px -8px rgba(224, 20, 20, 0.8);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 0.8rem; color: #fff;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.66rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.25rem; }

/* ============ Misc ============ */
.divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 61, 61, 0.35), transparent); margin: 20px 0; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted-foreground); }
.empty-state .icon { font-size: 2.4rem; margin-bottom: 12px; }
.pill-tabs { display: flex; gap: 6px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); border-radius: 999px; padding: 5px; width: fit-content; }
.pill-tab {
  padding: 7px 18px; border-radius: 999px; font-size: 0.78rem;
  font-family: var(--font-display); font-weight: 600;
  cursor: pointer; color: var(--muted-foreground);
  transition: color 0.18s ease, background 0.18s ease;
}
.pill-tab:hover { color: var(--foreground); }
.pill-tab.active { background: var(--gradient-blood); color: #fff; box-shadow: 0 6px 18px -8px rgba(224, 20, 20, 0.9); }
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: linear-gradient(160deg, #1c1524, #120d18);
  border: 1px solid rgba(255, 61, 61, 0.3);
  border-radius: var(--r-md);
  padding: 14px 18px;
  box-shadow: var(--glow);
  font-size: 0.85rem;
  min-width: 240px;
  animation: toast-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes toast-in { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.lock-note { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.1em; padding: 14px; }
.readiness-banner {
  border-radius: var(--r-lg); padding: 18px 24px; border: 1px solid var(--border); margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.readiness-banner.ready { background: linear-gradient(120deg, rgba(47, 224, 139, 0.12), rgba(47, 224, 139, 0.03)); border-color: rgba(47, 224, 139, 0.4); }
.readiness-banner.pending { background: linear-gradient(120deg, rgba(255, 176, 32, 0.12), rgba(255, 176, 32, 0.03)); border-color: rgba(255, 176, 32, 0.4); }
.readiness-banner.review { background: linear-gradient(120deg, rgba(79, 179, 255, 0.12), rgba(79, 179, 255, 0.03)); border-color: rgba(79, 179, 255, 0.4); }
.readiness-banner.blocked { background: linear-gradient(120deg, rgba(255, 61, 61, 0.14), rgba(255, 61, 61, 0.03)); border-color: var(--border-hot); }

.checklist-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.checklist-item input { width: 17px; height: 17px; accent-color: var(--blood-bright); }

.material-card { display: flex; align-items: flex-start; gap: 14px; }
.material-icon {
  width: 44px; height: 44px; border-radius: var(--r-md); flex-shrink: 0;
  background: linear-gradient(140deg, rgba(255, 61, 61, 0.14), rgba(0, 0, 0, 0.3));
  border: 1px solid rgba(255, 61, 61, 0.25);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}

/* ============ Movimento reduzido ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ Responsivo ============ */
@media (max-width: 980px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .status-row .badge { min-width: 150px; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    border-radius: 0 var(--r-xl) var(--r-xl) 0;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 40px 0 100px -30px rgba(0, 0, 0, 0.95); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(4, 2, 6, 0.7); z-index: 19; }
  .sidebar-overlay.open { display: block; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--r-md);
    background: var(--surface); border: 1px solid var(--border); color: var(--foreground);
    cursor: pointer; font-size: 1.1rem;
  }
  .main-content { padding: 18px; }
  .topbar { padding: 0 16px; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .hero-panel-inner { padding: 24px; }
  .hero-side { align-items: flex-start; }
}

@media (max-width: 600px) {
  .modal-box { max-width: 100%; border-radius: var(--r-lg); }
  .slideover-panel { width: 100%; border-radius: 0; }
  .slideover-header { border-radius: 0; }

  .etapa-row { flex-wrap: wrap; row-gap: 8px; }
  .etapa-row .etapa-title { flex-basis: 100%; order: 1; }
  .etapa-row .etapa-meta { order: 2; }
  .etapa-row .badge { order: 3; margin-left: auto; }

  .day-card-head .flex-between { flex-direction: column; align-items: stretch !important; }
  .login-screen::before, .login-screen::after { display: none; }
  .status-row { flex-wrap: wrap; }
  .status-row .badge { min-width: 0; }
  .status-bar { flex-basis: 100%; order: 3; }
}
