/* ── TOKENS (paleta WAYX HUB: verde/preto, tipografia arredondada) ── */
:root {
  --bg:      #0a0c0b;
  --s1:      #101312;
  --s2:      #171b19;
  --s3:      #1c211f;
  --b1:      rgba(255,255,255,0.10);
  --b2:      rgba(255,255,255,0.16);
  --accent:  #22c55e;
  --accent2: #6ee7a8;
  --accentg: rgba(34,197,94,0.12);
  --accentb: rgba(34,197,94,0.28);
  --txt:     #e7efea;
  --txt2:    #8a9490;
  --txt3:    #57615c;
  --green:   #4ade80;
  --greeng:  rgba(74,222,128,0.12);
  --red:     #f87171;
  --redg:    rgba(248,113,113,0.12);
  --blue:    #60a5fa;
  --blueg:   rgba(96,165,250,0.12);
  --amber:   #fbbf24;
  --amberg:  rgba(251,191,36,0.12);
  --purple:  #a78bfa;
  --purpleg: rgba(167,139,250,0.12);
  --sid:     220px;
  --top:     52px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 13px; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 2px; }

a { color: inherit; text-decoration: none; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sid);
  background: var(--s1);
  border-right: 1px solid var(--b1);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sb-logo {
  padding: 22px 20px;
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sb-logo-icon {
  width: 32px; height: 32px;
  background: var(--accentg);
  border: 1px solid var(--accentb);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px; font-weight: 700; color: var(--accent2);
  flex-shrink: 0;
}

.sb-logo-nome {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px; font-weight: 600;
  color: var(--txt); letter-spacing: -0.01em;
}
.sb-logo-nome span { color: var(--accent2); }

.sb-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }

.sb-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 11px; border-radius: 8px;
  cursor: pointer; color: var(--txt2);
  font-size: 12.5px; transition: background 0.15s, color 0.15s;
  position: relative;
}
.sb-item:hover { background: var(--s3); color: var(--txt); }
.sb-item.active { background: var(--accentg); color: var(--accent2); }
.sb-item.active::before {
  content: ''; position: absolute; left: -12px; top: 0; bottom: 0;
  width: 2px; background: var(--accent2);
}
.sb-icon { width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; opacity: 0.85; }
.sb-item.active .sb-icon { opacity: 1; }

.sb-user {
  margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--b1);
  display: flex; align-items: center; gap: 10px;
}
.sb-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accentg); border: 1px solid var(--accentb);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--accent2); flex-shrink: 0;
}
.sb-user-info { min-width: 0; flex: 1; }
.sb-user-nome { font-size: 11.5px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-sub { font-size: 9.5px; color: var(--txt3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-acoes { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sb-acao { display: flex; cursor: pointer; color: var(--txt3); transition: color 0.15s; }
.sb-acao:hover { color: var(--accent2); }
.sb-acoes .sb-acao:last-child:hover { color: var(--red); }

/* ── LAYOUT ── */
.main { margin-left: var(--sid); min-height: 100vh; }

.topbar {
  height: var(--top);
  border-bottom: 1px solid var(--b1);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; background: var(--bg); z-index: 50;
}
.topbar-titulo { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 18px; color: var(--txt); }
.topbar-acoes { display: flex; align-items: center; gap: 14px; }

.conteudo { padding: 24px; }

/* ── SINO DE NOTIFICAÇÕES ── */
.sino { position: relative; cursor: pointer; font-size: 15px; color: var(--txt2); }
.sino:hover { color: var(--txt); }
.sino-badge {
  position: absolute; top: -5px; right: -7px;
  background: var(--red); color: #0a0c0b;
  font-size: 8.5px; font-family: 'JetBrains Mono', monospace;
  min-width: 14px; height: 14px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.sino-painel {
  position: absolute; top: 40px; right: 24px; width: 340px; max-height: 420px;
  background: var(--s2); border: 1px solid var(--b1); border-radius: 14px;
  overflow-y: auto; z-index: 200; display: none; box-shadow: 0 8px 24px rgba(34,197,94,0.10), 0 2px 8px rgba(0,0,0,0.4);
}
.sino-painel.show { display: block; }
.sino-item {
  padding: 12px 14px; border-bottom: 1px solid var(--b1); font-size: 11.5px; cursor: pointer;
}
.sino-item:hover { background: var(--s3); }
.sino-item.nao-lida { border-left: 2px solid var(--accent2); }
.sino-item-msg { color: var(--txt); margin-bottom: 3px; }
.sino-item-data { color: var(--txt3); font-size: 9.5px; }
.sino-vazio { padding: 24px; text-align: center; color: var(--txt3); font-size: 11.5px; }
.sino-topo {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--b1);
  font-size: 10.5px; color: var(--txt2); text-transform: uppercase; letter-spacing: 0.08em;
}
.sino-marcar-todas { color: var(--accent2); cursor: pointer; text-transform: none; letter-spacing: 0; }

/* ── KPI CARDS ── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi {
  background: var(--s1); border: 1px solid var(--b1); border-radius: 16px; padding: 16px 18px;
}
.kpi-label { font-size: 10px; color: var(--txt3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.kpi-valor { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 28px; color: var(--txt); }
.kpi-valor.gold { color: var(--accent2); }
.kpi-valor.green { color: var(--green); }
.kpi-valor.red { color: var(--red); }
.kpi-sub { font-size: 10.5px; color: var(--txt2); margin-top: 4px; }

/* ── CARD / PAINEL ── */
.painel { background: var(--s1); border: 1px solid var(--b1); border-radius: 16px; padding: 18px; margin-bottom: 18px; max-width: 100%; overflow-x: auto; }
.painel-titulo { font-size: 12.5px; color: var(--txt); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }

/* ── FILTROS ── */
.filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filtros select, .filtros input {
  background: var(--s2); border: 1px solid var(--b1); color: var(--txt);
  padding: 7px 10px; border-radius: 8px; font-size: 11.5px; font-family: inherit;
}
.filtros input[type="text"] { min-width: 200px; }

/* ── BOTÕES ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; font-size: 11.5px; font-family: inherit;
  border: 1px solid var(--b1); background: var(--s2); color: var(--txt); cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { background: var(--s3); }
.btn-ouro { background: var(--accent); border-color: var(--accent); color: #06120a; font-weight: 500; }
.btn-ouro:hover { background: var(--accent2); border-color: var(--accent2); }
.btn-perigo { background: var(--redg); border-color: rgba(248,113,113,0.3); color: var(--red); }
.btn-sm { padding: 5px 9px; font-size: 10.5px; }

/* ── TABELA ── */
table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
th {
  text-align: left; padding: 10px 12px; color: var(--txt3);
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--b1); font-weight: 400;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--b1); color: var(--txt); }
tr:hover td { background: var(--s2); }
tr.linha-clicavel { cursor: pointer; }

/* selects e checkboxes dentro de tabela (ex: papel/ativo em Equipe) */
table select {
  background: var(--s2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a9490' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 9px;
  border: 1px solid var(--b1); color: var(--txt);
  padding: 6px 26px 6px 10px; border-radius: 8px; font-size: 11px; font-family: inherit;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
table select:hover:not(:disabled) { border-color: var(--b2); }
table select:disabled { opacity: 0.45; cursor: not-allowed; }
table select option { background: var(--s2); color: var(--txt); }

table input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer;
}
table input[type="checkbox"]:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px; font-size: 10px; white-space: nowrap;
}
.badge-pendente     { background: var(--blueg);   color: var(--blue); }
.badge-em_andamento { background: var(--amberg);  color: var(--amber); }
.badge-concluida    { background: var(--greeng);  color: var(--green); }
.badge-atrasada     { background: var(--redg);    color: var(--red); }
.badge-cancelada    { background: var(--s3);      color: var(--txt3); }
.badge-fatal        { background: var(--redg); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.badge-normal       { background: var(--s3); color: var(--txt2); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-baixa  { background: var(--txt3); }
.dot-media  { background: var(--blue); }
.dot-alta   { background: var(--red); }

/* ── KANBAN ── */
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: start; }
.kanban-col { background: var(--s1); border: 1px solid var(--b1); border-radius: 14px; padding: 12px; min-height: 120px; }
.kanban-col-titulo {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt3);
  margin-bottom: 10px; display: flex; justify-content: space-between;
}
.kanban-card {
  background: var(--s2); border: 1px solid var(--b1); border-radius: 10px;
  padding: 10px 11px; margin-bottom: 8px; cursor: pointer; font-size: 11px;
}
.kanban-card:hover { border-color: var(--b2); }
.kanban-card-titulo { color: var(--txt); margin-bottom: 6px; }
.kanban-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 9.5px; color: var(--txt3); }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 300; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--s1); border: 1px solid var(--b1); border-radius: 20px;
  width: 520px; max-width: 92vw; max-height: 88vh; overflow-y: auto; padding: 22px;
}
.modal-titulo { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 18px; margin-bottom: 16px; }
.campo { margin-bottom: 12px; }
.campo label { display: block; font-size: 10.5px; color: var(--txt2); margin-bottom: 5px; }
.campo input, .campo select, .campo textarea {
  width: 100%; background: var(--s2); border: 1px solid var(--b1); color: var(--txt);
  padding: 9px 11px; border-radius: 8px; font-size: 12px; font-family: inherit;
}
.campo textarea { resize: vertical; min-height: 60px; }
.campo-linha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--s2); border: 1px solid var(--b1);
  border-radius: 12px; padding: 12px 16px; min-width: 240px; z-index: 400;
  opacity: 0; transform: translateY(8px); transition: all 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-title { font-size: 11.5px; color: var(--txt); margin-bottom: 2px; }
.toast-msg { font-size: 10.5px; color: var(--txt2); }

/* ── HISTÓRICO / TIMELINE ── */
.timeline-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--b1); font-size: 11px; }
.timeline-item.sistema { opacity: 0.7; }
.timeline-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); margin-top: 5px; flex-shrink: 0; }
.timeline-item.sistema .timeline-dot { background: var(--txt3); }
.timeline-texto { color: var(--txt); }
.timeline-meta { color: var(--txt3); font-size: 9.5px; margin-top: 2px; }

/* ── LOGIN ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; background: var(--s1); border: 1px solid var(--b1); border-radius: 22px; padding: 32px 28px; }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo-nome { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 24px; color: var(--txt); }
.login-logo-nome span { color: var(--accent2); }
.login-sub { font-size: 10.5px; color: var(--txt3); text-align: center; margin-top: 4px; }
.erro {
  display: none; background: var(--redg); border: 1px solid rgba(248,113,113,0.3); color: var(--red);
  padding: 9px 12px; border-radius: 8px; font-size: 11px; margin-bottom: 12px;
}
.erro.show { display: block; }

/* ── VAZIO ── */
.vazio { text-align: center; padding: 40px 20px; color: var(--txt3); font-size: 12px; }

/* ── DASHBOARD: grade dos dois gráficos ── */
.dash-graficos { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ── MENU MOBILE (hambúrguer + sidebar off-canvas) ──
   escondido em telas largas; a media query abaixo é o que ativa tudo isso */
.sb-toggle {
  display: none; background: none; border: none; color: var(--txt);
  cursor: pointer; padding: 6px; margin-right: 8px; flex-shrink: 0;
}
.sb-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 90;
}
.sb-overlay.show { display: block; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: 1fr; }
  .dash-graficos { grid-template-columns: 1fr; }

  /* sidebar vira painel off-canvas: escondida por padrão, entra por cima do
     conteúdo (não empurra mais nada com margin-left) quando o hambúrguer abre */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 32px rgba(0,0,0,0.5);
    width: min(var(--sid), 82vw);
  }
  .sidebar.show-mobile { transform: translateX(0); }
  .main { margin-left: 0; }
  .sb-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .topbar { padding: 0 16px; }
  .conteudo { padding: 16px; }

  /* elementos com largura fixa que não cabiam em telas estreitas */
  .sino-painel { width: calc(100vw - 24px); max-width: 340px; right: 12px; }
  .login-card { width: min(340px, 92vw); }
  .modal { padding: 18px; }
  .campo-linha { grid-template-columns: 1fr; }
}
