/* ============================================================================
   GLOBAL SIDEBAR - CSS UNICO consumido por:
   - React (frontend/src/GlobalSidebar.jsx) via <link> em index.html
   - Jira (frontend/src/jira/) via build SPA

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

.gsidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 60px;
  /* DS .ds-sidebar: gradiente verde escuro tokenizado (green-950 → green-900) */
  background: linear-gradient(180deg, var(--nav-bg-from, var(--green-950, #072116)) 0%, var(--nav-bg-to, var(--green-900, #04321F)) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  transition: width var(--motion-base, 220ms) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)), box-shadow var(--motion-base, 220ms) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  z-index: 50;
  overflow: hidden;
  box-shadow: none;
}
.gsidebar.expanded {
  width: 210px;
  box-shadow: 8px 0 36px rgba(0, 0, 0, 0.22);
}

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

/* Toggle (hamburguer) - primeira linha, full-width, sem border-radius */
.gsidebar-toggle {
  height: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--nav-text-soft, rgba(255, 255, 255, 0.55));
  padding: 0 20px;
}
.gsidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Items dentro de nav/footer - com padding lateral e border-radius */
.gsidebar-nav,
.gsidebar-footer {
  padding: 12px 8px;
}
.gsidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.gsidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.gsidebar-nav .gsidebar-item,
.gsidebar-footer .gsidebar-item {
  height: 44px;
  padding: 0 15px;
  border-radius: var(--r-md, 10px);
}
.gsidebar-nav .gsidebar-item:hover,
.gsidebar-footer .gsidebar-item:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

/* Estado ativo (página atual) — igual ao DS .ds-sidebar__item.is-active */
.gsidebar-item.active {
  background: var(--nav-active-bg, linear-gradient(135deg, rgba(45, 174, 126, 0.32), rgba(45, 174, 126, 0.14)));
  color: #fff;
  font-weight: var(--fw-extrabold, 800);
}
.gsidebar-item.active svg {
  stroke: var(--nav-accent, #63CBA0);
}

/* 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;
}

/* Icone - caixa 22x22 (svg 20px) — reduzido um pouco a pedido */
.gsidebar-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}
.gsidebar-icon svg {
  width: 20px;
  height: 20px;
}

/* Label - anima max-width + opacity (igual DS .ds-sidebar__label) */
.gsidebar-label {
  white-space: nowrap;
  font-size: var(--fs-body, 13px);
  font-weight: inherit;
  letter-spacing: 0.1px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity var(--motion-fast, 150ms) var(--ease-out, ease), max-width var(--motion-base, 220ms) var(--ease-out, ease);
}
.gsidebar.expanded .gsidebar-label {
  max-width: 150px;
  opacity: 1;
}

/* Colapsada: ícone 100% centralizado (igual DS) */
.gsidebar:not(.expanded) .gsidebar-toggle,
.gsidebar:not(.expanded) .gsidebar-item {
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
}

/* 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;
}

/* ============================================================================
   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;
  /* borda = cor do fundo da sidebar (recorte do badge), agora o verde escuro do DS */
  border: 2px solid var(--nav-bg-from, var(--green-950, #072116));
  box-sizing: content-box;
}
.gsidebar.expanded .gnotif-badge {
  border-color: var(--nav-bg-to, var(--green-900, #04321F));
}

.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: var(--green, #096840); 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: var(--green, #096840); font-weight: 800; font-size: 12px;
  padding: 4px 6px; border-radius: 6px;
  font-family: inherit;
}
.gnotif-link-btn:hover { background: rgba(9, 104, 64, 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(9, 104, 64, 0.06);
  border-left: 3px solid var(--green, #096840);
  padding-left: 19px;
}
.gnotif-item.unread:hover { background: rgba(9, 104, 64, 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: var(--green, #096840); border-color: var(--green, #096840); color: #fff;
}

/* ============================================================================
   TOAST GENÉRICO — usado por notificações (realtime) e quick-create do Jira
   ============================================================================ */
.gtoast {
  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;
}
.gtoast.active { opacity: 1; transform: translateX(-50%) translateY(0); }
.gtoast.danger { background: #DC2626; }
.gtoast.clickable {
  pointer-events: auto;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px 12px 20px;
}
.gtoast-link {
  color: var(--nav-accent-2, #9CE0C2); font-weight: 800;
  text-decoration: none;
  padding: 6px 10px; border-radius: 6px;
  background: rgba(45, 174, 126, 0.18);
  transition: background 120ms ease;
}
.gtoast-link:hover { background: rgba(45, 174, 126, 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: 10px;
  padding: 11px 15px;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.38);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  pointer-events: none;
  opacity: 0;
  transform-origin: left center;
  transform: translateY(-50%) translateX(-12px) scale(0.86);
  /* Entrada lúdica: spring com leve overshoot. top/left animam pra que, ao
     passar o mouse de um ícone pro outro, a tooltip DESLIZE suave acompanhando
     em vez de teleportar. */
  transition:
    opacity 180ms ease,
    transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1),
    top 320ms cubic-bezier(0.22, 1, 0.36, 1),
    left 320ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity, top, left;
}
.gtip.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
}
/* Reposicionamento instantâneo na 1ª aparição (não desliza da posição antiga). */
.gtip.gtip-instant {
  transition: none;
}
/* Conteúdo entra com um respiro a mais que o balão — efeito "em cascata". */
.gtip-title,
.gtip-desc {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 200ms ease 80ms, transform 260ms cubic-bezier(0.22, 1, 0.36, 1) 80ms;
}
.gtip-desc { transition-delay: 130ms; }
.gtip.visible .gtip-title,
.gtip.visible .gtip-desc {
  opacity: 1;
  transform: translateX(0);
}
.gtip.gtip-instant .gtip-title,
.gtip.gtip-instant .gtip-desc { transition: none; }
.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;
}

/* ─── Jira: drawer global de tasks "Prontas" (atalho J) ─────────────────── */
.jira-ready-drawer { position: fixed; inset: 0; z-index: 1200; visibility: hidden; }
.jira-ready-drawer.open { visibility: visible; }
.jira-ready-backdrop {
  position: absolute; inset: 0; opacity: 0;
  background: color-mix(in srgb, var(--slate-900) 40%, transparent);
  transition: opacity .2s ease;
}
.jira-ready-drawer.open .jira-ready-backdrop { opacity: 1; }
.jira-ready-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 360px; max-width: 92vw;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .22s cubic-bezier(0.16,1,0.3,1);
}
.jira-ready-drawer.open .jira-ready-panel { transform: translateX(0); }
.jira-ready-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 700; color: var(--text);
}
.jira-ready-close {
  appearance: none; border: none; background: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; width: 28px; height: 28px; border-radius: 6px;
}
.jira-ready-close:hover { background: var(--surface-hover); color: var(--text); }
.jira-ready-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.jira-ready-state { padding: 40px 0; text-align: center; color: var(--text-muted); font-size: 14px; }
.jira-ready-item {
  display: block; width: 100%; text-align: left; appearance: none; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 10px 12px;
}
.jira-ready-item:hover { border-color: var(--primary); }
.jira-ready-item__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.jira-ready-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text-muted); }
.jira-ready-prio { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.jira-ready-prio--alta  { color: var(--danger);    background: color-mix(in srgb, var(--danger) 13%, var(--surface)); }
.jira-ready-prio--media { color: var(--amber-800); background: color-mix(in srgb, var(--amber-500) 20%, var(--surface)); }
.jira-ready-prio--baixa { color: var(--slate-600); background: color-mix(in srgb, var(--slate-500) 13%, var(--surface)); }
.jira-ready-title { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.jira-ready-mod { font-size: 12px; color: var(--text-muted); }

/* ─── Jira: criação rápida global (atalho N fora do /jira/) ─────────────── */
.jira-qc-drawer { position: fixed; inset: 0; z-index: 1200; visibility: hidden; }
.jira-qc-drawer.open { visibility: visible; }
.jira-qc-backdrop { position: absolute; inset: 0; opacity: 0;
  background: color-mix(in srgb, var(--slate-900) 40%, transparent); transition: opacity .2s ease; }
.jira-qc-drawer.open .jira-qc-backdrop { opacity: 1; }
.jira-qc-panel { position: absolute; top: 0; right: 0; height: 100%; width: 420px; max-width: 94vw;
  background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s cubic-bezier(0.16,1,0.3,1); }
.jira-qc-drawer.open .jira-qc-panel { transform: translateX(0); }
.jira-qc-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px;
  border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700; color: var(--text); }
.jira-qc-head small { color: var(--text-muted); font-weight: 500; }
.jira-qc-x { appearance: none; border: none; background: none; color: var(--text-muted); font-size: 16px;
  cursor: pointer; width: 28px; height: 28px; border-radius: 6px; }
.jira-qc-x:hover { background: var(--surface-hover); color: var(--text); }
.jira-qc-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.jira-qc-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-muted); margin-top: 10px; }
.jira-qc-input { width: 100%; padding: 9px 12px; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; font-family: inherit; box-sizing: border-box; }
.jira-qc-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.jira-qc-textarea { resize: vertical; }
.jira-qc-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.jira-qc-pill { appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); padding: 5px 12px; font-size: 13px; border-radius: 999px; cursor: pointer; }
.jira-qc-pill:hover { color: var(--text); }
.jira-qc-pill.active { border-color: var(--primary); color: var(--primary); font-weight: 600;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.jira-qc-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px;
  border-top: 1px solid var(--border); }
.jira-qc-cancel, .jira-qc-submit { appearance: none; border-radius: 8px; padding: 8px 16px; font-size: 14px;
  font-weight: 600; cursor: pointer; }
.jira-qc-cancel { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.jira-qc-cancel:hover { background: var(--surface-hover); }
.jira-qc-submit { border: none; background: var(--primary); color: var(--on-primary); }
.jira-qc-submit:hover { filter: brightness(1.05); }
.jira-qc-submit:disabled { opacity: .6; cursor: default; }
