/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #232738;
  --border: #2e3347;
  --accent: #7c5cfc;
  --accent2: #5c8dfc;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --text: #e8eaf0;
  --text2: #8b90a7;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --bottom-nav-h: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── Login ───────────────────────────────────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(135deg, #0f1117 0%, #1a1d27 100%);
  padding: 24px;
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo { font-size: 2.8rem; margin-bottom: 10px; }
.login-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; }
.login-card p { color: var(--text2); font-size: 0.9rem; margin-bottom: 28px; }

.login-card input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.login-card input:focus { border-color: var(--accent); }

.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  -webkit-appearance: none;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }

.login-error {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 12px;
  display: none;
}

/* ── App shell ───────────────────────────────────────────────────────────── */
#app { display: none; }

/* ── Top header (mobile) ─────────────────────────────────────────────────── */
.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
}

.top-header-left { display: flex; align-items: center; gap: 10px; }
.top-header h1 { font-size: 1rem; font-weight: 700; }
.top-header .app-icon { font-size: 1.3rem; }

.btn-mobile-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.workspace-selector select {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
  max-width: 130px;
}

/* ── Main content ────────────────────────────────────────────────────────── */
.main {
  padding-top: 68px;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px);
  min-height: 100vh;
  min-height: 100dvh;
}

.page-header {
  padding: 16px 16px 8px;
}
.page-header h2 { font-size: 1.2rem; font-weight: 700; }
.page-header .date { color: var(--text2); font-size: 0.8rem; margin-top: 2px; }

/* ── Navigation Items ────────────────────────────────────────────────────── */

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--text2);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item .icon { font-size: 1.4rem; line-height: 1; }
.nav-item.active { color: var(--accent); }
.nav-item.active .icon { transform: scale(1.1); }

/* ── Métricas ────────────────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 12px;
}

.metric-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.metric-card.purple::before { background: var(--accent); }
.metric-card.blue::before   { background: var(--accent2); }
.metric-card.green::before  { background: var(--green); }
.metric-card.red::before    { background: var(--red); }

.metric-icon { font-size: 1.3rem; margin-bottom: 8px; }
.metric-value { font-size: 1.7rem; font-weight: 700; line-height: 1; margin-bottom: 3px; }
.metric-label { color: var(--text2); font-size: 0.75rem; }

/* ── Painéis ─────────────────────────────────────────────────────────────── */
.panels-stack { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 12px; }

.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 0.92rem; font-weight: 600; }
.count {
  background: var(--bg3);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.78rem;
  color: var(--text2);
}

.panel-body { padding: 12px 16px; }

/* ── Task Items ──────────────────────────────────────────────────────────── */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.task-item:last-child { border-bottom: none; }
.task-item:active { background: rgba(255,255,255,0.03); }

.task-status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.task-info { flex: 1; min-width: 0; }
.task-name {
  font-size: 0.88rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.task-meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; align-items: center; }
.task-tag {
  font-size: 0.7rem;
  color: var(--text2);
  background: var(--bg3);
  border-radius: 4px;
  padding: 1px 6px;
}

.task-due {
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 500;
}
.task-due.overdue  { background: rgba(239,68,68,0.15); color: var(--red); }
.task-due.today    { background: rgba(245,158,11,0.15); color: var(--yellow); }
.task-due.upcoming { background: rgba(34,197,94,0.15); color: var(--green); }

/* ── Gráfico de horas ────────────────────────────────────────────────────── */
.hours-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
}

.bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}
.bar-val { font-size: 0.6rem; color: var(--text2); text-align: center; min-height: 12px; }
.bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
}
.bar-label { font-size: 0.62rem; color: var(--text2); white-space: nowrap; }

/* ── Página de Tarefas ───────────────────────────────────────────────────── */
.filters {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text2);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.tasks-list { padding: 0 16px; }

.task-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.task-card:active { border-color: var(--accent); }

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.task-card-name { font-size: 0.92rem; font-weight: 600; flex: 1; line-height: 1.4; }

.task-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 500;
}

.priority-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: capitalize;
}

.task-card-assignees {
  display: flex;
  margin-top: 8px;
  gap: -4px;
}

/* ── Modal de Task ───────────────────────────────────────────────────────── */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
#modal-overlay.active { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; line-height: 1.4; flex: 1; }

.modal-close {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }

.modal-meta-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.modal-location { font-size: 0.78rem; color: var(--text2); margin-bottom: 14px; }
.modal-section { margin-bottom: 18px; }
.modal-section-title {
  font-size: 0.73rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text2); margin-bottom: 8px;
}
.modal-description {
  font-size: 0.88rem; line-height: 1.6;
  background: var(--bg3); border-radius: 8px; padding: 12px;
}

.assignees-row { display: flex; flex-wrap: wrap; gap: 7px; }
.assignee-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 10px 4px 4px; font-size: 0.8rem;
}

.time-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.time-chip {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px;
  font-size: 0.82rem; font-weight: 500;
}
.time-chip.green { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.08); }

.checklist-block { margin-bottom: 10px; }
.checklist-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; }
.checklist-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item.resolved { color: var(--text2); text-decoration: line-through; }

.custom-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.custom-field { background: var(--bg3); border-radius: 8px; padding: 9px 11px; }
.cf-label { font-size: 0.68rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
.cf-value { font-size: 0.85rem; font-weight: 500; }

.comment-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.comment-content { flex: 1; min-width: 0; }
.comment-header { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; flex-wrap: wrap; }
.comment-author { font-size: 0.82rem; font-weight: 600; }
.comment-date { font-size: 0.7rem; color: var(--text2); }
.comment-text { font-size: 0.84rem; line-height: 1.5; }

.btn-external {
  display: inline-block; padding: 10px 20px;
  background: none; border: 1px solid var(--accent);
  color: var(--accent); border-radius: 10px;
  font-size: 0.88rem; text-decoration: none;
}
.btn-external:active { background: var(--accent); color: #fff; }

/* ── Sidebar (desktop only) ──────────────────────────────────────────────── */
.sidebar { display: none; }

/* ── Loading / Empty ─────────────────────────────────────────────────────── */
.loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 32px; color: var(--text2);
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  text-align: center; padding: 32px 16px;
  color: var(--text2); font-size: 0.88rem;
}

.section-hidden { display: none !important; }

/* ── Banner de instalação PWA ────────────────────────────────────────────── */
#install-banner {
  display: none;
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
  left: 16px; right: 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  z-index: 150;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(124,92,252,0.4);
  animation: slideUp 0.3s ease;
}
#install-banner.show { display: flex; }
#install-banner p { font-size: 0.88rem; font-weight: 500; }
.banner-actions { display: flex; gap: 8px; }
.btn-install {
  flex: 1; padding: 9px;
  background: #fff; color: var(--accent);
  border: none; border-radius: 8px;
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.btn-dismiss {
  padding: 9px 14px;
  background: rgba(255,255,255,0.2); color: #fff;
  border: none; border-radius: 8px;
  font-size: 0.85rem; cursor: pointer;
}

/* ── Desktop: sidebar layout ─────────────────────────────────────────────── */
@media (min-width: 768px) {
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    width: 220px; height: 100vh;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 0;
    z-index: 100;
  }

  .sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 0 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700; font-size: 0.95rem;
  }
  .sidebar-logo span:first-child { font-size: 1.3rem; }

  .sidebar-user {
    padding: 16px;
    border-bottom: 1px solid var(--border);
  }
  .avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; margin-bottom: 7px;
  }
  .sidebar-user .name { font-weight: 600; font-size: 0.9rem; }
  .sidebar-user .email { color: var(--text2); font-size: 0.74rem; margin-top: 1px; }

  .sidebar-nav { padding: 12px 8px; flex: 1; overflow-y: auto; min-height: 0; }
  .sidebar-nav .nav-group + .nav-group { margin-top: 10px; }
  .sidebar-nav .nav-group-label {
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text2); opacity: 0.75; padding: 4px 10px 4px;
  }
  .sidebar-nav .nav-item {
    flex-direction: row; gap: 10px;
    padding: 8px 10px; border-radius: 10px;
    font-size: 0.88rem; color: var(--text2);
    margin-bottom: 2px; width: 100%; text-align: left;
    justify-content: flex-start;
  }
  .sidebar-nav .nav-item .icon { font-size: 1rem; width: 18px; text-align: center; }
  .sidebar-nav .nav-item:hover { background: var(--bg3); color: var(--text); }
  .sidebar-nav .nav-item.active { background: rgba(124,92,252,0.15); color: var(--accent); font-weight: 600; }

  .sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
  .btn-logout {
    display: flex; align-items: center; gap: 8px;
    background: none; border: 1px solid var(--border);
    color: var(--text2); border-radius: 8px;
    padding: 8px 12px; font-size: 0.82rem;
    cursor: pointer; width: 100%;
  }
  .btn-logout:hover { border-color: var(--red); color: var(--red); }

  .top-header { left: 220px; }
  .btn-mobile-menu { display: none; }

  .main {
    margin-left: 220px;
    padding-top: 68px;
    padding-bottom: 24px;
  }

  .page-header { padding: 20px 24px 10px; }
  .page-header h2 { font-size: 1.4rem; }

  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 0 24px 16px;
    gap: 14px;
  }

  .panels-stack { padding: 0 24px 16px; flex-direction: row; flex-wrap: wrap; gap: 16px; }
  .panels-stack .panel { flex: 1; min-width: 280px; }
  .panels-stack .panel.full { flex: 100%; }
  /* #roblox-games-grid não é um .panel, então nunca herdava o flex:100% acima
     — sem isso ele só encolhia pro tamanho do próprio conteúdo dentro da linha
     flex, deixando o resto da largura da tela vazio à direita. */
  .panels-stack #roblox-games-grid { flex: 100%; }

  .filters { padding: 12px 24px; }
  .tasks-list { padding: 0 24px; }

  .task-card { border-radius: 14px; }

  #modal-overlay { align-items: center; }
  .modal { border-radius: 18px; max-width: 660px; }
  .modal-handle { display: none; }

  #install-banner { bottom: 24px; max-width: 400px; left: 50%; transform: translateX(-50%); right: auto; }
}

/* ── Notificações ────────────────────────────────────────────────────────── */
.notif-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: var(--red);
  color: #fff;
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0 4px;
  position: absolute;
  top: 4px;
  right: 8px;
}
.sidebar-nav .notif-badge { position: static; margin-left: auto; }

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:active { background: rgba(255,255,255,0.02); }

.notif-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 0.88rem; font-weight: 600; margin-bottom: 3px; }
.notif-body { font-size: 0.82rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.notif-time { font-size: 0.72rem; color: var(--text2); }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 72px; right: 16px;
  z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  max-width: 340px;
  width: calc(100vw - 32px);
}

.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  pointer-events: all; cursor: pointer;
  transform: translateX(110%);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s;
  opacity: 0;
  border-left: 3px solid var(--accent);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.toast-body { font-size: 0.78rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-close { background: none; border: none; color: var(--text2); font-size: 0.8rem; cursor: pointer; padding: 2px 4px; flex-shrink: 0; }

/* ── Área de Gestão ──────────────────────────────────────────────────────── */
.report-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.report-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.report-filter-group label {
  font-size: 0.75rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-filter-group input[type="date"] {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}
.report-filter-group input[type="date"]:focus { border-color: var(--accent); }

.btn-report {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-report:hover { opacity: 0.88; }
.btn-report:active { opacity: 0.75; }

.report-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shortcut-btn {
  padding: 6px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text2);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.shortcut-btn:hover { border-color: var(--accent); color: var(--accent); }

.report-result-area { display: flex; flex-direction: column; gap: 16px; }

.report-summary-bar {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.report-summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.report-summary-item:last-child { border-right: none; }
.rsb-val { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.rsb-label { font-size: 0.72rem; color: var(--text2); margin-top: 3px; }

/* Cartão do membro */
.report-member-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.report-member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.report-member-identity { display: flex; align-items: center; gap: 12px; }

.report-avatar-img { width: 44px; height: 44px; border-radius: 50%; }
.report-avatar-placeholder {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: #fff;
  flex-shrink: 0;
}

.report-member-name { font-weight: 700; font-size: 1rem; }
.report-member-email { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }

.report-member-total { text-align: right; }
.report-total-hours { font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1; }
.report-total-label { font-size: 0.72rem; color: var(--text2); margin-top: 2px; }

/* Projetos */
.report-projects-section { padding: 0 20px 8px; }

.report-project { margin: 16px 0; }

.report-project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.report-project-name { font-weight: 700; font-size: 0.92rem; }
.report-project-hours { font-weight: 700; font-size: 0.92rem; color: var(--accent2); }

/* Tabela de tasks */
.report-tasks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  overflow-x: auto;
  display: block;
}
.report-tasks-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text2);
  font-size: 0.7rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.report-tasks-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.report-tasks-table tr:last-child td { border-bottom: none; }
.report-tasks-table tr:hover td { background: rgba(255,255,255,0.02); }

.task-name-cell { font-weight: 500; max-width: 200px; }
.task-name-cell:hover { color: var(--accent); }
.task-list-label { font-size: 0.7rem; color: var(--text2); font-weight: 400; }

.diff-cell { font-weight: 600; font-size: 0.8rem; }
.diff-cell.over { color: var(--red); }
.diff-cell.under { color: var(--green); }

/* Resumo IA */
.report-ai-section { padding: 16px 20px; border-top: 1px solid var(--border); }

.btn-ai-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #7c5cfc, #5c8dfc);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-ai-summary:hover { opacity: 0.88; }

.ai-summary-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  border-left: 3px solid var(--accent);
}
.ai-summary-box.error { border-left-color: var(--red); }

.ai-summary-header {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text2);
  margin-bottom: 10px;
}

.ai-summary-text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
}

@media (min-width: 768px) {
  .report-tasks-table { display: table; }
  .task-name-cell { max-width: 320px; }
  .rsb-val { font-size: 1.4rem; }
}

/* ── Seletor de Colaboradores ─────────────────────────────────────────────── */
.member-selector-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.member-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.member-chip:hover { border-color: var(--accent); }
.member-chip:active { transform: scale(0.98); }

.member-chip.selected {
  border-color: var(--accent);
  background: rgba(124, 92, 252, 0.1);
}

.member-chip-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.member-chip-avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.member-chip-info { flex: 1; min-width: 0; }
.member-chip-name { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-chip-email { font-size: 0.74rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.member-chip-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  transition: all 0.15s;
}

.member-chip.selected .member-chip-check {
  background: var(--accent);
  border-color: var(--accent);
}

/* Chips de Presença (Dailies) */
.attendance-chip { transition: all 0.2s ease; border-width: 1px; }
.attendance-chip.present { border-color: var(--green); background: rgba(34, 197, 94, 0.05); }
.attendance-chip.absent { 
  border-color: var(--red); 
  background: rgba(239, 68, 68, 0.08); 
}
.attendance-chip.justified { border-color: var(--yellow); background: rgba(245, 158, 11, 0.08); }
.attendance-chip.unmarked { border-style: dashed; opacity: 0.75; }

/* ── Calendário de Presenças (Dailies) ───────────────────────────────────── */
.att-cal-cell {
  cursor: pointer;
  min-height: 80px;
}
.att-cal-cell:hover {
  border-color: var(--accent);
  background: rgba(124,92,252,0.05);
}
.att-cal-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 6px;
}
.att-cal-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--bg2);
  object-fit: cover;
}
.att-cal-avatar.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem; font-weight: 700; color: #fff;
}
.att-cal-avatar.more {
  background: var(--bg3); color: var(--text2); font-size: 0.6rem;
  display: flex; align-items: center; justify-content: center;
}

/* ── Inputs Genéricos ────────────────────────────────────────────────────── */
.rpg-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.rpg-input:focus { border-color: var(--accent); }

.rpg-class-name {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.rpg-class-description {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  min-height: 50px;
}

@media (min-width: 600px) {
  .member-selector-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .member-selector-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Seletor Global de Colaborador ───────────────────────────────────────── */
.top-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.collab-selector-wrap {
  position: relative;
  display: none;
  align-items: center;
}

.collab-selector-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 10px 5px 5px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.collab-selector-btn:hover { border-color: var(--accent); }

.collab-selector-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.collab-selector-name {
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collab-selector-arrow {
  font-size: 0.65rem;
  color: var(--text2);
}

/* Dropdown */
.collab-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  z-index: 200;
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
}

.collab-dropdown.open { display: block; }

.collab-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}
.collab-drop-item:last-child { border-bottom: none; }
.collab-drop-item:hover { background: var(--bg3); }
.collab-drop-item.active { background: rgba(124,92,252,0.1); }

.collab-drop-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.collab-drop-avatar.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #fff;
}

.collab-drop-info { flex: 1; min-width: 0; }
.collab-drop-name { font-size: 0.86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collab-drop-email { font-size: 0.72rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Perfil de Performance ───────────────────────────────────────────────── */
.profile-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: 16px;
}

.profile-identity { display: flex; align-items: center; gap: 14px; }
.profile-name { font-size: 1.2rem; font-weight: 700; }
.profile-email { font-size: 0.8rem; color: var(--text2); margin-top: 2px; }

.profile-score-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-score-val { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.profile-score-label { font-size: 0.65rem; color: var(--text2); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }

/* KPIs grid */
.profile-kpis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.kpi-icon { font-size: 1.3rem; margin-bottom: 6px; }
.kpi-value { font-size: 1.5rem; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: 0.75rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.kpi-sub { font-size: 0.68rem; color: var(--text2); }

/* Painéis internos do perfil */
.profile-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.profile-panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Barras de prioridade */
.priority-bars { display: flex; flex-direction: column; gap: 10px; }
.priority-bar-row { display: flex; align-items: center; gap: 10px; }
.priority-bar-label { font-size: 0.8rem; min-width: 110px; }
.priority-bar-track {
  flex: 1; height: 8px;
  background: var(--bg3); border-radius: 4px; overflow: hidden;
}
.priority-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.priority-bar-count { font-size: 0.78rem; min-width: 60px; text-align: right; }
.priority-bar-count span { color: var(--text2); }

/* Tabela de perfil */
.profile-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.profile-table th {
  text-align: left; padding: 7px 8px;
  color: var(--text2); font-size: 0.7rem;
  text-transform: uppercase; border-bottom: 1px solid var(--border);
}
.profile-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.profile-table tr:last-child td { border-bottom: none; }
.profile-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Barra de progresso */
.progress-bar-wrap {
  height: 6px; background: var(--bg3);
  border-radius: 3px; overflow: hidden; margin-bottom: 2px;
  min-width: 60px;
}
.progress-bar { height: 100%; border-radius: 3px; transition: width 0.4s; }
.progress-label { font-size: 0.72rem; color: var(--text2); }

/* Gargalos */
.bottleneck-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.bottleneck-item:last-child { border-bottom: none; }
.bottleneck-item:hover .bottleneck-name { color: var(--accent); }

.bottleneck-days {
  min-width: 40px; height: 40px;
  border-radius: 8px;
  background: rgba(239,68,68,0.15);
  color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  flex-shrink: 0;
}
.bottleneck-info { flex: 1; min-width: 0; }
.bottleneck-name { font-size: 0.88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottleneck-meta { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; }

/* ── Calendário de Presenças (Perfil) ────────────────────────────────────── */
.attendance-calendar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0;
}

.attendance-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 60px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: transform 0.15s, border-color 0.15s;
  cursor: default;
}
.attendance-day:hover { transform: scale(1.05); }

.attendance-day.present {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}
.attendance-day.absent {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.08);
}
.attendance-day.justified {
  border-color: var(--yellow);
  background: rgba(245, 158, 11, 0.08);
}
.attendance-day.no-record { opacity: 0.5; }

.attendance-day-status { font-size: 0.9rem; margin-bottom: 2px; }
.attendance-day.present .attendance-day-status { color: var(--green); }
.attendance-day.absent .attendance-day-status { color: var(--red); }
.attendance-day.justified .attendance-day-status { color: var(--yellow); }
.attendance-day.no-record .attendance-day-status { color: var(--text2); }

.attendance-day-num {
  font-size: 0.85rem; font-weight: 700; color: var(--text);
  line-height: 1; margin-bottom: 2px;
}
.attendance-day-weekday { font-size: 0.6rem; text-transform: uppercase; color: var(--text2); }

@media (min-width: 600px) {
  .profile-kpis-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 900px) {
  .profile-kpis-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Documentos ──────────────────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px;
  height: calc(100vh - 140px);
}

.docs-sidebar-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 280px;
}

.docs-search-wrap {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.docs-search-wrap input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.88rem;
  outline: none;
}
.docs-search-wrap input:focus { border-color: var(--accent); }

#docs-list {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.doc-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.doc-list-item:last-child { border-bottom: none; }
.doc-list-item:hover { background: var(--bg3); }
.doc-list-item.active { background: rgba(124,92,252,0.12); border-left: 3px solid var(--accent); }

.doc-list-icon { font-size: 1.2rem; flex-shrink: 0; }
.doc-list-info { flex: 1; min-width: 0; }
.doc-list-name { font-size: 0.88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list-meta { font-size: 0.72rem; color: var(--text2); margin-top: 2px; display: flex; gap: 4px; }

/* Painel de conteúdo */
.docs-content-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 300px;
}

.docs-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  color: var(--text2);
  text-align: center;
  padding: 32px;
}

/* Doc viewer */
.doc-viewer { padding: 20px; }

.doc-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.doc-viewer-title { font-size: 1.1rem; font-weight: 700; }
.doc-pages-count { font-size: 0.78rem; color: var(--text2); background: var(--bg3); padding: 3px 10px; border-radius: 20px; }

/* Ask AI box */
.doc-ai-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 20px;
  border-left: 3px solid var(--accent);
}
.doc-ai-label { font-size: 0.78rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.doc-ai-input-row { display: flex; gap: 8px; }
.doc-ai-input-row input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.88rem;
  outline: none;
}
.doc-ai-input-row input:focus { border-color: var(--accent); }

.doc-ai-answer-box {
  margin-top: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.doc-ai-answer-box.error { border-color: var(--red); }
.doc-ai-answer-q { font-size: 0.78rem; color: var(--text2); margin-bottom: 8px; font-style: italic; }
.doc-ai-answer-text { font-size: 0.88rem; line-height: 1.6; }

/* Páginas do doc */
.doc-pages { display: flex; flex-direction: column; gap: 10px; }

.doc-page {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.doc-page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.doc-page-header:hover { background: rgba(255,255,255,0.03); }

.doc-page-icon { font-size: 0.7rem; color: var(--text2); width: 12px; }
.doc-page-name { font-weight: 600; font-size: 0.9rem; flex: 1; }
.doc-page-date { font-size: 0.72rem; color: var(--text2); }

.doc-page-content {
  padding: 16px;
  font-size: 0.88rem;
  line-height: 1.7;
  border-top: 1px solid var(--border);
  overflow-x: auto;
}

.doc-page.collapsed .doc-page-content { display: none; }
.doc-page.collapsed .doc-page-header { border-top: none; }

.doc-page-content h1 { font-size: 1.3rem; margin: 16px 0 8px; }
.doc-page-content h2 { font-size: 1.1rem; margin: 14px 0 6px; }
.doc-page-content h3 { font-size: 0.95rem; margin: 12px 0 5px; color: var(--text2); }
.doc-page-content ul { padding-left: 20px; margin: 8px 0; }
.doc-page-content li { margin-bottom: 4px; }
.doc-page-content code { background: var(--bg2); padding: 1px 6px; border-radius: 4px; font-size: 0.82rem; }
.doc-page-content strong { color: var(--text); }

@media (min-width: 768px) {
  .docs-layout { flex-direction: row; padding: 0 24px 24px; height: calc(100vh - 100px); }
  .docs-sidebar-panel { width: 300px; flex-shrink: 0; max-height: none; }
  .docs-content-panel { flex: 1; }
}

/* ── Calendário ──────────────────────────────────────────────────────────── */
.calendar-wrap {
  padding: 0 16px 24px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.calendar-nav h3 {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  flex: 1;
  text-transform: capitalize;
}

.cal-nav-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.cal-nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 4px;
}

.calendar-grid-header div {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  padding: 4px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-cell {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 80px;
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s;
  overflow: hidden;
}

.cal-cell.empty {
  background: transparent;
  border-color: transparent;
}

.cal-cell.today {
  border-color: var(--accent);
  background: rgba(124,92,252,0.06);
}

.cal-cell.past {
  opacity: 0.65;
}

.cal-day-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 2px;
}

.cal-cell.today .cal-day-num {
  color: var(--accent);
  font-size: 0.82rem;
}

.cal-task-chip {
  font-size: 0.68rem;
  line-height: 1.3;
  padding: 3px 5px;
  border-radius: 4px;
  background: var(--chip-bg, var(--bg3));
  color: var(--chip-color, inherit);
  border-left: 3px solid var(--chip-color, var(--accent));
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: filter 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.cal-task-chip:hover { filter: brightness(1.2); }

.cal-more {
  font-size: 0.65rem;
  color: var(--text2);
  padding: 2px 4px;
  text-align: center;
  cursor: pointer;
}

/* ── Tooltip de Task ─────────────────────────────────────────────────────── */
.task-tooltip {
  position: fixed;
  z-index: 500;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  width: 280px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.15s, transform 0.15s;
}

.task-tooltip.visible {
  opacity: 1;
  transform: scale(1);
}

.tip-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.tip-rows { display: flex; flex-direction: column; gap: 7px; }

.tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
}

.tip-label {
  color: var(--text2);
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.tip-avatars {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tip-avatar-img {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg2);
  object-fit: cover;
}

.tip-avatar-placeholder {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700; color: #fff;
  border: 2px solid var(--bg2);
}

.tip-hint {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text2);
  text-align: center;
}

@media (min-width: 768px) {
  .calendar-wrap { padding: 0 24px 24px; }
  .cal-cell { min-height: 110px; padding: 8px; }
  .cal-task-chip { font-size: 0.74rem; padding: 4px 7px; }
  .cal-day-num { font-size: 0.85rem; }
}

/* ── Calendário — controles ──────────────────────────────────────────────── */
.calendar-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.cal-filters {
  display: flex;
  gap: 6px;
}

.cal-filter-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cal-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (min-width: 768px) {
  .calendar-controls { flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 16px; }
  .calendar-nav { margin-bottom: 0; }
}

/* ── Projetos ────────────────────────────────────────────────────────────── */
.proj-select-wrap { display: flex; flex-direction: column; gap: 5px; }
.proj-select-label { font-size: 0.75rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; }
.proj-select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.92rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.proj-select:focus { border-color: var(--accent); }

/* Cabeçalho do projeto */
.proj-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.proj-header-name { font-size: 1.15rem; font-weight: 700; }
.proj-header-period { font-size: 0.8rem; color: var(--text2); margin-top: 3px; }

.proj-completion-wrap { text-align: center; min-width: 100px; }
.proj-completion-val { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.proj-completion-label { font-size: 0.72rem; color: var(--text2); margin: 2px 0 6px; }
.proj-completion-bar-track {
  height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden;
}
.proj-completion-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

/* KPIs do projeto */
.proj-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.proj-kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}
.proj-kpi-icon { font-size: 1.1rem; margin-bottom: 4px; }
.proj-kpi-value { font-size: 1.3rem; font-weight: 700; line-height: 1; margin-bottom: 3px; }
.proj-kpi-label { font-size: 0.68rem; color: var(--text2); }

/* Painéis do projeto */
.proj-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
}

.proj-panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Colaboradores do projeto */
.proj-collab-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.proj-collab-row:last-child { border-bottom: none; }

.proj-collab-identity { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.proj-collab-name { font-weight: 600; font-size: 0.88rem; }
.proj-collab-tasks { font-size: 0.74rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.proj-collab-hours { font-weight: 700; font-size: 1rem; color: var(--accent); flex-shrink: 0; }

/* Texto do relatório IA de projeto */
.proj-ai-text { line-height: 1.7; }
.proj-ai-section-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin: 14px 0 6px;
  color: var(--accent2);
}

@media (min-width: 600px) {
  .proj-kpis { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  .proj-kpis { grid-template-columns: repeat(5, 1fr); }
}

/* Página Roblox: cada seção (visão geral, Demografia, Benchmark, Economia,
   Aquisição, ações) é um bloco de largura total empilhado verticalmente — e
   DENTRO de cada bloco, os jogos ficam em colunas (.roblox-game-columns). Isso
   é o que faz "Demografia" de um jogo começar exatamente na mesma altura que
   a do outro, mesmo com listas de tamanhos diferentes: o grid dimensiona a
   linha pelo conteúdo mais alto e todas as colunas partem do mesmo topo — sem
   precisar calcular espaçamento manual pra compensar a diferença. */
#roblox-games-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.roblox-game-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}
@media (min-width: 900px) {
  .roblox-game-columns { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* .proj-kpis normalmente escolhe 4/5 colunas com base na largura da TELA
   (media query), o que funciona quando o painel ocupa a tela toda. Mas aqui
   cada jogo já divide o espaço em .roblox-game-columns, então aquela contagem
   fixa espremia os cards de KPI numa fração da largura real. Sobrescrevendo só
   dentro do contexto do Roblox pra reagir ao espaço de verdade disponível. */
.roblox-game-columns .proj-kpis {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

/* Cada jogo, dentro de uma seção comparativa, ganha sua própria "caixa"
   (fundo mais claro, borda, cantos arredondados) — sem isso os dois jogos
   ficavam só divididos por uma linha fina, parecendo um bloco só. */
.roblox-compare-col {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

/* ── Refresh button & timestamp ──────────────────────────────────────────── */
.header-refresh-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.last-update-label {
  font-size: 0.7rem;
  color: var(--text2);
  white-space: nowrap;
  display: none;
}

@media (min-width: 768px) {
  .last-update-label { display: block; }
}

.btn-refresh {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.btn-refresh:hover { border-color: var(--accent); transform: rotate(30deg); }
.btn-refresh:active { transform: rotate(180deg); }

/* ── Skeleton screens ────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--border) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-icon  { width: 28px; height: 28px; border-radius: 50%; margin-bottom: 10px; }
.skeleton-value { width: 60%; height: 28px; margin-bottom: 6px; }
.skeleton-label { width: 80%; height: 12px; }

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.skeleton-row:last-child { border-bottom: none; }
.skeleton-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.skeleton-row-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skeleton-line       { width: 80%; height: 13px; }
.skeleton-line-short { width: 45%; height: 10px; }

/* ── Comparação de períodos ───────────────────────────────────────────────── */
.metric-delta {
  margin-top: 4px;
  min-height: 16px;
}

/* ── Gráfico de evolução (trend 4 semanas) ───────────────────────────────── */
.trend-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.trend-badge {
  font-size: 0.82rem;
  font-weight: 700;
}

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 120px;
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.trend-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.trend-bar-val {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  min-height: 16px;
  text-align: center;
}

.trend-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
}

.trend-bar-label {
  font-size: 0.72rem;
  color: var(--text2);
  text-align: center;
  white-space: nowrap;
}

.trend-bar-label.current {
  color: var(--accent);
  font-weight: 700;
}

/* ── Estado vazio contextual ─────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 16px;
  gap: 6px;
}

.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.empty-state-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.empty-state-sub {
  font-size: 0.82rem;
  color: var(--text2);
  max-width: 280px;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .trend-chart { height: 150px; gap: 20px; }
  .trend-bar-label { font-size: 0.78rem; }
}

/* ── Drawer "Mais" (mobile) ──────────────────────────────────────────────── */
.more-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 190;
}
.more-drawer-overlay.open { display: block; }

.more-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 0 20px calc(20px + var(--safe-bottom));
  z-index: 195;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.34,1.4,0.64,1);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}
.more-drawer.open { transform: translateY(0); }

.more-drawer-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 16px;
}

.more-drawer-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text2);
  margin-bottom: 16px;
}

.more-drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.more-drawer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  color: var(--text2);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.more-drawer-item:active { transform: scale(0.96); }
.more-drawer-item.active {
  background: rgba(124,92,252,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.more-drawer-icon { font-size: 1.5rem; }

/* Swipe down to close drawer via touch */

/* ── Loading Overlay inicial ─────────────────────────────────────────────── */
#app-loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.app-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 32px;
}

.app-loading-logo {
  font-size: 3rem;
  margin-bottom: 4px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

.app-loading-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.app-loading-spinner {
  margin: 4px 0;
}

.app-loading-sub {
  font-size: 0.82rem;
  color: var(--text2);
}

/* ── KPI comparison delta ────────────────────────────────────────────────── */
.kpi-comparison {
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
}
.kpi-comparison.up   { color: var(--green); background: rgba(34,197,94,0.1); }
.kpi-comparison.down { color: var(--red);   background: rgba(239,68,68,0.1); }

/* ── Profile evolution chart ─────────────────────────────────────────────── */
.profile-evolution { }

.evolution-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 110px;
  margin-bottom: 8px;
}

.evo-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.evo-vals {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  min-height: 28px;
  gap: 1px;
}
.evo-done  { color: var(--green); font-weight: 600; }
.evo-hours { color: var(--accent2); font-weight: 600; }

.evo-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  flex: 1;
}

.evo-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: height 0.4s ease;
}
.evo-bar.done  { background: var(--green);   opacity: 0.85; }
.evo-bar.hours { background: var(--accent2); opacity: 0.75; }

.evo-label {
  font-size: 0.62rem;
  color: var(--text2);
  text-align: center;
  white-space: nowrap;
  margin-top: 2px;
}

.evo-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: 6px;
}
.evo-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.evo-legend-dot.done  { background: var(--green); }
.evo-legend-dot.hours { background: var(--accent2); }

@media (min-width: 600px) {
  .evolution-chart { height: 140px; gap: 12px; }
  .evo-label { font-size: 0.7rem; }
}

/* ── Sprint task list ────────────────────────────────────────────────────── */
.sprint-task-list .task-item {
  padding: 10px 0;
}

/* ── Export bar ──────────────────────────────────────────────────────────── */
.export-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.export-bar-label {
  font-size: 0.82rem;
  color: var(--text2);
  font-weight: 500;
  flex-shrink: 0;
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-export:hover { border-color: var(--accent); color: var(--accent); }
.btn-export:active { transform: scale(0.97); }

/* ── Dashboard toggle ────────────────────────────────────────────────────── */
.dashboard-toggle-wrap {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
}

.dash-toggle-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.dash-toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.dash-toggle-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Team dashboard ──────────────────────────────────────────────────────── */
.team-members-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

.team-member-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.team-member-card:hover  { border-color: var(--accent); }
.team-member-card:active { transform: scale(0.99); }

.team-member-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.team-member-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: #fff;
  flex-shrink: 0;
}
.team-member-avatar-img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.team-member-info   { flex: 1; min-width: 0; }
.team-member-name   { font-weight: 700; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-member-load-label { font-size: 0.74rem; font-weight: 600; margin-top: 2px; }
.team-member-hours  { font-weight: 700; font-size: 1rem; color: var(--accent2); flex-shrink: 0; }

.team-load-bar-track {
  height: 5px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.team-load-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.team-mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.team-mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--bg3);
  border-radius: 6px;
  padding: 6px 4px;
}
.tms-val { font-size: 1rem; font-weight: 700; line-height: 1; }
.tms-lbl { font-size: 0.62rem; color: var(--text2); text-align: center; }

@media (min-width: 600px) {
  .team-members-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .team-members-grid { grid-template-columns: repeat(3, 1fr); padding: 0 24px 24px; }
  .dashboard-toggle-wrap { padding: 0 24px 12px; max-width: 400px; }
}

/* ── Busca global ────────────────────────────────────────────────────────── */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 400;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px 16px;
}
.search-overlay.open { display: flex; }

.search-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.search-icon { font-size: 1.1rem; color: var(--text2); flex-shrink: 0; }

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
#search-input::placeholder { color: var(--text2); }

.search-close-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  padding: 3px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.search-results {
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.search-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--text2);
  font-size: 0.88rem;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg3); }

.search-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.search-item-info { flex: 1; min-width: 0; }
.search-item-name {
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-item-name mark {
  background: rgba(124,92,252,0.25);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 1px;
}
.search-item-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .search-overlay { padding-top: 80px; }
}

/* ── Barra de progresso do relatório ─────────────────────────────────────── */
.report-progress-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}

.report-progress-msg {
  font-size: 0.88rem;
  color: var(--text2);
  margin-bottom: 12px;
  min-height: 20px;
}

.report-progress-track {
  height: 8px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.report-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ── Áudio IA ──────────────────────────────────────────────────────────────── */
.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.suggestion-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.suggestion-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.suggestion-title {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}

.suggestion-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-copy {
  padding: 4px 10px;
  font-size: 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 6px;
  cursor: pointer;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }

.suggestion-desc { font-size: 0.85rem; line-height: 1.6; color: var(--text2); }
.transcription-text { font-size: 0.85rem; line-height: 1.7; color: var(--text2); white-space: pre-wrap; }

.report-progress-pct {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 600;
}

/* ── Tooltip genérico (só CSS, sem JS) ──────────────────────────────────────
   Qualquer elemento com [data-tip="texto"] ganha um popup ao passar o mouse
   (ou focar via teclado/toque, por causa do tabindex que sempre acompanha o
   atributo). Usado nos gráficos/métricas do Roblox pra explicar o que cada
   número significa, sem precisar de nenhuma lib de tooltip externa. */
[data-tip] {
  position: relative;
  cursor: help;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  width: max-content;
  max-width: 250px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  z-index: 60;
  pointer-events: none;
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}
/* Perto da borda direita da tela o popup centralizado vazaria pra fora —
   alinha pela direita nesse caso em vez de centralizar. */
[data-tip].tip-right::after {
  left: auto;
  right: 0;
  transform: none;
}

/* ── Propostas ─────────────────────────────────────────────────────────────── */
.proposal-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; background: var(--bg3); transition: opacity 0.2s; }
.proposal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.proposal-title { font-weight: 700; font-size: 1rem; }
.proposal-desc { font-size: 0.85rem; line-height: 1.5; margin: 8px 0; padding: 10px; border-left: 3px solid var(--accent); background: rgba(124, 92, 252, 0.05); border-radius: 4px; }
.proposal-sub { font-size: 0.82rem; margin: 6px 0; }
.proposal-sub ul { margin: 4px 0 0 18px; }
.proposal-edit { margin-top: 10px; }
.proposal-edit summary { cursor: pointer; font-size: 0.85rem; color: var(--accent); margin-bottom: 8px; }
.proposal-form { display: flex; flex-direction: column; gap: 10px; font-size: 0.8rem; }
.proposal-form label, .pf-label { display: flex; flex-direction: column; gap: 4px; color: var(--text2); }
.proposal-form .pf-row { display: flex; gap: 10px; flex-wrap: wrap; }
.proposal-form .pf-row label { flex: 1; min-width: 120px; }
.proposal-people { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.proposal-person { flex-direction: row !important; align-items: center; gap: 6px !important; color: var(--text) !important; cursor: pointer; }
.proposal-person-none { display: inline-flex; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.proposal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.proposal-error { color: var(--red); font-size: 0.8rem; margin-top: 6px; }
.demand-item { border-bottom: 1px solid var(--border); padding: 8px 0; }
.demand-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.72rem; color: var(--text2); margin-bottom: 4px; }
.demand-text { font-size: 0.85rem; line-height: 1.45; white-space: pre-wrap; }

/* ── Relatórios do agente ──────────────────────────────────────────────────── */
.agent-report-meta { font-size: 0.75rem; color: var(--text2); margin-bottom: 6px; }
.agent-report-details summary { cursor: pointer; font-size: 0.82rem; color: var(--accent); margin: 4px 0 8px; }
.agent-report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.agent-briefing summary { cursor: pointer; list-style: none; }
.agent-briefing-empty { font-size: 0.82rem; color: var(--text2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.report-row input { margin-top: 4px; }
.report-row-main { flex: 1; cursor: pointer; }
.report-row-title { font-size: 0.88rem; font-weight: 600; }
.report-row-meta { font-size: 0.75rem; color: var(--text2); margin-top: 2px; }
.report-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report-compare-col { min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
@media (max-width: 800px) { .report-compare { grid-template-columns: 1fr; } }

/* ── Trello ─────────────────────────────────────────────────────────────────── */
.no-hours-note { font-size: 0.78rem; color: var(--text2); margin: -4px 0 12px; }

.nav-hidden { display: none !important; }
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; margin-top: 10px; }

/* ── Impacto ─────────────────────────────────────────────────────────────── */
.impact-tiles { margin-bottom: 16px; }
.impact-sub { font-size: 0.75rem; color: var(--text2); margin-top: 6px; line-height: 1.4; }
.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.impact-grid .panel.full { grid-column: 1 / -1; }
.impact-bars { display: flex; flex-direction: column; gap: 8px; }
.impact-bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 0.84rem; }
.impact-bar-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.impact-bar-track { height: 10px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.impact-bar-fill { display: block; height: 100%; background: var(--accent2); border-radius: 0 4px 4px 0; min-width: 2px; }
.impact-bar-value { font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: right; }

/* ── Login (acesso pelo link) ────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.login-card .goal-field { min-width: 0; }
.login-brand { font-size: 0.85rem; color: var(--text2); margin-bottom: 14px; }
.login-card h1 { font-size: 1.4rem; }
.login-sub { font-size: 0.82rem; color: var(--text2); margin-top: 4px; line-height: 1.5; }
.login-error { font-size: 0.82rem; color: var(--red); min-height: 1em; }
.login-error:empty { display: none; }

/* ── Acesso pelo link (Admin) ────────────────────────────────────────────── */
.access-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--bg3); border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; }
.access-link code { word-break: break-all; }
.access-users { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin-top: 12px; }
.access-users th, .access-users td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.access-users th { color: var(--text2); font-weight: 500; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
.access-secret { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.4); border-radius: 8px; padding: 10px 12px; font-size: 0.84rem; line-height: 1.5; margin-top: 10px; }
.access-secret code { font-size: 0.95rem; user-select: all; }
.audit-note { font-size: 0.8rem; color: var(--text2); line-height: 1.5; }
.backup-row { font-size: 0.85rem; padding: 8px 10px; border-radius: 8px; background: var(--bg3); margin-top: 6px; line-height: 1.5; }
.backup-row code { word-break: break-all; }
.backup-row.warn { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.35); }
.backup-row.ok { background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.3); }
.audit-table-wrap { overflow-x: auto; }

/* ── Objetivos ───────────────────────────────────────────────────────────── */
#section-goals [hidden] { display: none !important; }
.goals-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.goals-header .date { max-width: 640px; line-height: 1.45; }
.goals-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; flex: 100%; }
#impact-filter .shortcut-btn.active,
#goals-filter .shortcut-btn.active { border-color: var(--accent); color: var(--text); background: rgba(124, 92, 252, 0.16); }
.goal-archived-toggle { font-size: 0.8rem; color: var(--text2); display: flex; gap: 6px; align-items: center; cursor: pointer; margin-left: auto; }
#goals-list { flex: 100%; display: flex; flex-direction: column; gap: 20px; }

.goal-tiles { flex: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.goal-tiles:empty { display: none; }
.goal-tile { background: var(--bg2); border: 1px solid var(--border); border-left-width: 4px; border-radius: 12px; padding: 12px 14px; }
.goal-tile.tone-green { border-left-color: var(--green); }
.goal-tile.tone-yellow { border-left-color: var(--yellow); }
.goal-tile.tone-red { border-left-color: var(--red); }
.goal-tile-value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.goal-tile-label { font-size: 0.74rem; color: var(--text2); margin-top: 4px; line-height: 1.35; }

.goal-group-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.goal-group-title h3 { font-size: 1.05rem; font-weight: 700; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }

.goal-card { background: var(--bg2); border: 1px solid var(--border); border-top: 3px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.goal-card.tone-green { border-top-color: var(--green); }
.goal-card.tone-yellow { border-top-color: var(--yellow); }
.goal-card.tone-red { border-top-color: var(--red); }
.goal-card.archived { opacity: 0.6; }
.goal-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.goal-metric { font-weight: 700; font-size: 0.95rem; }
.goal-desc { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }
.goal-status { font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; border: 1px solid var(--border); color: var(--text); }
.goal-status.tone-green { border-color: rgba(34, 197, 94, 0.5); background: rgba(34, 197, 94, 0.12); }
.goal-status.tone-yellow { border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.12); }
.goal-status.tone-red { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.12); }

.goal-numbers { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.goal-current { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.goal-target { color: var(--text2); font-size: 0.9rem; }
.goal-target-edit { background: none; border: 1px dashed transparent; border-radius: 6px; padding: 2px 6px; cursor: pointer; font-family: inherit; }
.goal-target-edit:hover { border-color: var(--border); color: var(--text); }
.goal-pct { margin-left: auto; font-weight: 700; font-size: 0.95rem; }

.goal-bar { position: relative; height: 8px; background: var(--bg3); border-radius: 4px; }
.goal-bar-fill { height: 100%; border-radius: 4px; background: var(--accent2); transition: width 0.4s ease; }
.goal-bar-fill.tone-green { background: var(--green); }
.goal-bar-fill.tone-yellow { background: var(--yellow); }
.goal-bar-fill.tone-red { background: var(--red); }
.goal-bar-mark { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text); border-radius: 1px; transform: translateX(-1px); cursor: help; }
.goal-deadline { font-size: 0.76rem; color: var(--text2); }
.goal-urgent { color: var(--yellow); }

.goal-facts { list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 0.8rem; border-top: 1px solid var(--border); padding-top: 10px; }
.goal-facts li { display: flex; justify-content: space-between; gap: 10px; }
.goal-facts li > span:first-child { color: var(--text2); white-space: nowrap; }
.goal-facts li b { font-weight: 600; text-align: right; }
.goal-hint { color: var(--text2); font-weight: 400; font-size: 0.74rem; }
.goal-hint-box { font-size: 0.78rem; color: var(--text2); background: var(--bg3); border-radius: 8px; padding: 8px 10px; }
.goal-error { font-size: 0.78rem; color: var(--red); background: rgba(239, 68, 68, 0.08); border-radius: 8px; padding: 8px 10px; }
.goal-error-text { font-size: 0.78rem; color: var(--yellow); }
.goal-error-text:empty { display: none; }
.goal-notes { font-size: 0.78rem; color: var(--text2); line-height: 1.45; white-space: pre-wrap; }

.goal-spark { margin: 0; }
.goal-spark svg { width: 100%; height: 64px; display: block; overflow: visible; }
.goal-spark-line { fill: none; stroke: var(--accent2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.goal-spark-target { stroke: var(--text2); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.goal-spark-dot { fill: var(--accent2); stroke: var(--bg2); stroke-width: 2; vector-effect: non-scaling-stroke; }
.goal-spark-hit { fill: transparent; cursor: crosshair; }
.goal-spark-hit:hover { fill: rgba(92, 141, 252, 0.35); }
.goal-spark figcaption { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text2); margin-top: 2px; }
.goal-spark-legend { display: flex; align-items: center; gap: 5px; }
.goal-legend-line, .goal-legend-target { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--accent2); }
.goal-legend-target { border-top: 1px dashed var(--text2); margin-left: 6px; }

.goal-checkin { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.goal-checkin-form { display: grid; grid-template-columns: 130px 1fr auto; gap: 6px; }
.goal-checkin-form .rpg-input { padding: 7px 10px; font-size: 0.82rem; }
.goal-checkin-form .btn-report { padding: 7px 14px; font-size: 0.82rem; }
.goal-checkin-list summary { font-size: 0.76rem; color: var(--text2); cursor: pointer; }
.goal-checkin-list ul { list-style: none; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; }
.goal-checkin-list li { display: grid; grid-template-columns: 48px auto 1fr auto; gap: 8px; align-items: center; }

.goal-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; border-top: 1px solid var(--border); padding-top: 10px; }
.goal-meta { font-size: 0.7rem; color: var(--text2); }
.goal-actions { display: flex; gap: 2px; flex-wrap: wrap; }
.goal-link { background: none; border: none; color: var(--text2); font-size: 0.74rem; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.goal-link:hover { color: var(--text); background: var(--bg3); }
.goal-link.danger:hover { color: var(--red); }

.goal-empty { text-align: center; padding: 40px 16px; background: var(--bg2); border: 1px dashed var(--border); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.goal-empty p { color: var(--text2); font-size: 0.85rem; max-width: 460px; line-height: 1.5; }

.goal-form { display: flex; flex-direction: column; gap: 12px; }
.goal-form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.goal-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 200px; }
.goal-field-sm { flex: 0 0 120px; min-width: 120px; }
.goal-field > span { font-size: 0.72rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; }
.goal-field > span em { text-transform: none; font-style: normal; color: var(--text); }
.goal-relative summary { font-size: 0.82rem; color: var(--text2); cursor: pointer; margin-bottom: 8px; }
.goal-baseline-btn { height: 40px; }
.goal-form-actions { display: flex; gap: 8px; }

@media (max-width: 520px) {
  .goal-checkin-form { grid-template-columns: 1fr 1fr; }
  .goal-checkin-form .btn-report { grid-column: 1 / -1; }
  .goal-current { font-size: 1.6rem; }
}
