/* ============================================================================
   GLOBAL SIDEBAR - CSS UNICO consumido por:
   - React (frontend/src/GlobalSidebar.jsx) via <link> em index.html
   - Backlog estatico (frontend/public/backlog/index.html) via <link>

   Mudou aqui = mudou nos dois apps automaticamente.
   ============================================================================ */

.gsidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 56px;
  background: linear-gradient(180deg, #0a2418 0%, #0f3a26 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  transition: width 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms;
  z-index: 50;
  overflow: hidden;
  box-shadow: none;
}
.gsidebar.expanded {
  width: 200px;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.18);
}

/* Linha base - usada por toggle + items + footer pra alinhamento consistente */
.gsidebar-toggle,
.gsidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  text-align: left;
  transition: background 150ms ease, color 150ms ease;
  width: 100%;
  padding: 0;
}

/* Toggle (hamburguer) - primeira linha, full-width, sem border-radius */
.gsidebar-toggle {
  height: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  padding: 0 18px;
}
.gsidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Items dentro de nav/footer - com padding lateral e border-radius */
.gsidebar-nav,
.gsidebar-footer {
  padding: 10px 6px;
}
.gsidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gsidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.gsidebar-nav .gsidebar-item,
.gsidebar-footer .gsidebar-item {
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
}
.gsidebar-nav .gsidebar-item:hover,
.gsidebar-footer .gsidebar-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Estado ativo (página atual) */
.gsidebar-item.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(16, 185, 129, 0.14));
  color: #fff;
  font-weight: 800;
  box-shadow: inset 3px 0 0 #34D399;
}
.gsidebar-item.active svg {
  stroke: #6EE7B7;
}

/* Estado danger (logout) */
.gsidebar-footer .gsidebar-item {
  color: rgba(255, 255, 255, 0.7);
}
.gsidebar-footer .gsidebar-item:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #FCA5A5;
}

/* Botão "Notificações" — hover neutro (não é destrutivo, override do danger) */
.gsidebar-footer .gsidebar-bell:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Botão "Reportar" — vermelho de destaque, sempre visível */
.gsidebar-footer .gsidebar-report {
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.14);
  margin-bottom: 4px;
}
.gsidebar-footer .gsidebar-report:hover {
  background: rgba(239, 68, 68, 0.32);
  color: #fff;
}
.gsidebar-footer .gsidebar-report svg {
  stroke: currentColor;
}

/* Icone - caixa fixa de 20x20 pra alinhamento perfeito entre items */
.gsidebar-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}
.gsidebar-icon svg {
  stroke-width: 2.3;
}

/* Label - escondido quando colapsado (fade), aparece quando expandido */
.gsidebar-label {
  white-space: nowrap;
  font-size: 13px;
  font-weight: inherit;
  letter-spacing: 0.1px;
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
}
.gsidebar.expanded .gsidebar-label {
  opacity: 1;
  pointer-events: auto;
}

/* Brand (logo Helios) - aparece dentro do toggle quando expandido.
   Container 56px alto; logo 36px deixa ~10px respiro top/bottom. */
.gsidebar-brand {
  display: none;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.gsidebar.expanded .gsidebar-brand {
  display: flex;
}
.gsidebar-brand img {
  height: 36px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* ============================================================================
   REPORT DRAWER — formulário cross-app de "Reportar problema ou sugestão"
   Append no <body> uma vez por sessão. Aparece em todos os apps.
   ============================================================================ */
.greport-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 9998;
}
.greport-overlay.open { opacity: 1; pointer-events: auto; }

.greport-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 100vw;
  background: #fff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  display: flex; flex-direction: column;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
}
.greport-drawer.open { transform: translateX(0); }

.greport-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #E5E7EB;
}
.greport-eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  color: #EF4444; margin-bottom: 4px;
}
.greport-title {
  font-size: 18px; font-weight: 800; color: #111827;
}
.greport-close {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; color: #6B7280;
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.greport-close:hover { background: #F3F4F6; color: #111; }

.greport-body {
  flex: 1; overflow-y: auto;
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 18px;
}

.greport-field { display: flex; flex-direction: column; gap: 6px; }
.greport-field label {
  font-size: 11px; font-weight: 800; color: #374151;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.greport-req { color: #EF4444; }

.greport-field input[type="text"],
.greport-field textarea {
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: #111827;
  padding: 10px 12px;
  border: 1px solid #D1D5DB; border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.greport-field input[type="text"]:focus,
.greport-field textarea:focus {
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.greport-field textarea { resize: vertical; min-height: 100px; }
.greport-hint {
  font-size: 11px; color: #6B7280; font-weight: 500;
  margin-top: 2px;
}

.greport-radio-group { display: flex; gap: 8px; }
.greport-radio {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border: 1px solid #D1D5DB; border-radius: 8px;
  font-size: 13px; font-weight: 700; color: #374151;
  cursor: pointer;
  transition: all 120ms ease;
}
.greport-radio:hover { border-color: #9CA3AF; }
.greport-radio.active {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
}
.greport-radio input { accent-color: #10B981; }

.greport-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.greport-chip {
  font-family: inherit; font-size: 12px; font-weight: 700;
  padding: 6px 12px;
  border: 1px solid #D1D5DB; border-radius: 999px;
  background: #fff; color: #374151;
  cursor: pointer;
  transition: all 120ms ease;
}
.greport-chip:hover { border-color: #9CA3AF; }
.greport-chip.selected {
  background: #10B981; border-color: #10B981; color: #fff;
}

.greport-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid #E5E7EB;
  background: #F9FAFB;
}
.greport-btn {
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid #D1D5DB; background: #fff; color: #374151;
  cursor: pointer;
  transition: all 120ms ease;
}
.greport-btn:hover { background: #F3F4F6; }
.greport-btn.primary {
  background: #10B981; border-color: #10B981; color: #fff;
}
.greport-btn.primary:hover { background: #059669; border-color: #059669; }
.greport-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Toast genérico do report (usado quando o app não tem o seu próprio) */
.greport-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 10000;
}
.greport-toast.active { opacity: 1; transform: translateX(-50%) translateY(0); }
.greport-toast.danger { background: #DC2626; }
.greport-toast.clickable {
  pointer-events: auto;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px 12px 20px;
}

/* ============================================================================
   NOTIF DRAWER (sino) — sistema in-system, complemento do email/Reportar
   ============================================================================ */

/* Badge vermelho no ícone do sino */
.gsidebar-bell .gsidebar-icon {
  position: relative;
}
.gnotif-badge {
  position: absolute;
  top: -6px; right: -8px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: #EF4444; color: #fff;
  font-size: 9px; font-weight: 900;
  line-height: 16px; text-align: center;
  border-radius: 999px;
  border: 2px solid #0a2418;
  box-sizing: content-box;
}
.gsidebar.expanded .gnotif-badge {
  border-color: #0f3a26;
}

.gnotif-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 9996;
}
.gnotif-overlay.open { opacity: 1; pointer-events: auto; }

.gnotif-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 400px; max-width: 100vw;
  background: #fff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.16);
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9997;
  display: flex; flex-direction: column;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
}
.gnotif-drawer.open { transform: translateX(0); }

.gnotif-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #E5E7EB;
}
.gnotif-eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  color: #10B981; margin-bottom: 4px;
}
.gnotif-title { font-size: 18px; font-weight: 800; color: #111827; }
.gnotif-close {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; color: #6B7280;
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.gnotif-close:hover { background: #F3F4F6; color: #111; }

.gnotif-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px;
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
  font-size: 12px;
}
.gnotif-summary { color: #6B7280; font-weight: 700; }
.gnotif-link-btn {
  background: transparent; border: none; cursor: pointer;
  color: #10B981; font-weight: 800; font-size: 12px;
  padding: 4px 6px; border-radius: 6px;
  font-family: inherit;
}
.gnotif-link-btn:hover { background: rgba(16, 185, 129, 0.08); }

.gnotif-list {
  flex: 1; overflow-y: auto;
}
.gnotif-empty {
  padding: 40px 22px;
  text-align: center;
  color: #9CA3AF; font-weight: 600; font-size: 13px;
}
.gnotif-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 14px 22px;
  border-bottom: 1px solid #F3F4F6;
  cursor: pointer;
  transition: background 120ms ease;
}
.gnotif-item:hover { background: #F9FAFB; }
.gnotif-item.unread {
  background: rgba(16, 185, 129, 0.06);
  border-left: 3px solid #10B981;
  padding-left: 19px;
}
.gnotif-item.unread:hover { background: rgba(16, 185, 129, 0.10); }

.gnotif-item-main { flex: 1; min-width: 0; }
.gnotif-item-title {
  font-size: 13px; font-weight: 800; color: #111827;
  margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.gnotif-item-body {
  font-size: 12px; color: #4B5563; font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.gnotif-item-meta {
  font-size: 10px; color: #9CA3AF; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.gnotif-mark-btn {
  background: transparent; border: 1px solid #D1D5DB;
  width: 26px; height: 26px; border-radius: 6px;
  cursor: pointer; color: #6B7280; font-weight: 800;
  font-family: inherit; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.gnotif-mark-btn:hover {
  background: #10B981; border-color: #10B981; color: #fff;
}
.greport-toast-link {
  color: #6EE7B7; font-weight: 800;
  text-decoration: none;
  padding: 6px 10px; border-radius: 6px;
  background: rgba(16, 185, 129, 0.18);
  transition: background 120ms ease;
}
.greport-toast-link:hover { background: rgba(16, 185, 129, 0.32); color: #fff; }

/* ============================================================================
   EXTERNAL CONFIRM MODAL — sistemas externos (Universidade, Trepadeira, etc)
   Mostrado antes de abrir o link em nova aba.
   ============================================================================ */
.gext-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.gext-overlay.open { opacity: 1; pointer-events: auto; }

.gext-modal {
  background: #fff;
  border-radius: 14px;
  max-width: 420px; width: 100%;
  padding: 24px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  transform: scale(0.96);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.gext-overlay.open .gext-modal { transform: scale(1); }

.gext-eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  color: #096840; margin-bottom: 6px;
}
.gext-title {
  font-size: 20px; font-weight: 800; color: #111827;
  margin-bottom: 10px;
}
.gext-body {
  font-size: 13px; color: #4B5563; font-weight: 500;
  line-height: 1.5;
  margin-bottom: 20px;
}
.gext-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}
.gext-btn {
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 9px 18px; border-radius: 8px;
  border: 1px solid #D1D5DB; background: #fff; color: #374151;
  cursor: pointer;
  transition: all 120ms ease;
}
.gext-btn:hover { background: #F3F4F6; }
.gext-btn.primary {
  background: #096840; border-color: #096840; color: #fff;
}
.gext-btn.primary:hover { background: #075030; border-color: #075030; }

/* ============================================================================
   GLOBAL SIDEBAR TOOLTIP (custom) — substitui o title nativo do browser
   Aparece instantâneo no hover de itens da sidebar colapsada.
   Posicionado à direita do item, com seta apontando pra ele.
   ============================================================================ */
.gtip {
  position: fixed;
  z-index: 10001;
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity 100ms ease, transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
}
.gtip.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.gtip::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -5px;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #111827;
  border-radius: 1px;
}
.gtip-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.2px;
  line-height: 1.2;
}
.gtip-desc {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.4;
}
