/* ── Layout ── */
body { height: 100vh; overflow: hidden; }
#app { display: flex; flex-direction: column; height: 100vh; }
.layout { display: flex; flex: 1; overflow: hidden; }
aside {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow-y: auto;
  padding: 14px 10px;
}
.sidebar-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text3);
  margin: 10px 4px 6px;
}
.proj-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 6px;
  cursor: pointer; transition: background .12s;
  color: var(--text2); font-size: 13px; font-weight: 500;
}
.proj-item:hover { background: var(--bg3); color: var(--text); }
.proj-item.active { background: rgba(79,142,247,.12); color: var(--brand); }
.proj-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); flex-shrink: 0; }
.proj-item.active .proj-dot { background: var(--brand); box-shadow: 0 0 5px var(--brand); }
.proj-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { flex: 1; overflow-y: auto; padding: 24px; }
.content-wrap { max-width: 860px; margin: 0 auto; }

/* ── Toolbar ── */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h2 { font-size: 16px; font-weight: 600; flex: 1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters .btn-ghost {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.filters select:focus { border-color: var(--brand); }
.search-inp {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  padding: 7px 12px;
  outline: none;
  width: 240px;
  transition: border-color .15s;
}
.search-inp:focus { border-color: var(--brand); }
.search-inp::placeholder { color: var(--text3); }

/* ── Status / prioridade / tracker badges ── */
.s-backlog  { background: rgba(85,95,112,.2);    color: #6b7280; }
.s-planned  { background: rgba(79,142,247,.15);  color: var(--brand); }
.s-progress { background: rgba(251,146,60,.15);  color: var(--orange); }
.s-review   { background: rgba(167,139,250,.15); color: var(--purple); }
.s-done     { background: rgba(74,222,128,.12);  color: var(--green); }
.s-archived { background: rgba(55,65,81,.3);     color: var(--text3); }
.p-critical { background: rgba(248,113,113,.15); color: var(--red); }
.p-high     { background: rgba(251,146,60,.15);  color: var(--orange); }
.p-medium   { background: rgba(250,204,21,.12);  color: var(--yellow); }
.p-low      { background: rgba(85,95,112,.2);    color: var(--text3); }
.t-bug      { background: rgba(248,113,113,.15); color: var(--red); }
.t-feature  { background: rgba(74,222,128,.13);  color: var(--green); }
.t-task     { background: rgba(79,142,247,.12);  color: var(--brand); }

/* ── Issue cards ── */
.issue-list { display: flex; flex-direction: column; gap: 6px; }
.issue-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color .15s, background .12s, box-shadow .15s;
}
.issue-card:hover {
  border-color: var(--brand);
  background: var(--bg3);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.issue-card.prio-critical { border-left-color: var(--red); }
.issue-card.prio-high     { border-left-color: var(--orange); }
.issue-card.prio-medium   { border-left-color: var(--yellow); }
.issue-card.prio-low      { border-left-color: var(--text3); }
.issue-card.st-done, .issue-card.st-archived { opacity: .6; }
.card-subject {
  font-size: 13.5px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 7px;
}
.card-meta { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.card-id { font-family: var(--mono); font-size: 11px; color: var(--text3); }

/* ── Pagination ── */
.pagination {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px;
  font-size: 12px; color: var(--text3);
}
.pagination button {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); border-radius: 5px;
  padding: 5px 11px; cursor: pointer;
  font-size: 12px; font-family: 'Inter', sans-serif;
  transition: all .12s;
}
.pagination button:hover:not(:disabled) { border-color: var(--brand); color: var(--text); }
.pagination button:disabled { opacity: .35; cursor: not-allowed; }
.pagination select {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); border-radius: 5px;
  padding: 5px 8px; cursor: pointer;
  font-size: 12px; font-family: 'Inter', sans-serif; outline: none;
}
.page-info { flex: 1; text-align: center; }

/* ── List bar ── */
.list-bar { display: flex; align-items: center; margin-bottom: 12px; }
.list-bar .count { font-size: 12px; color: var(--text3); }
.list-bar .sort-wrap { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.sort-sel {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); border-radius: 5px;
  padding: 5px 8px; cursor: pointer;
  font-size: 12px; font-family: 'Inter', sans-serif;
  outline: none; transition: border-color .12s;
}
.sort-sel:hover { border-color: var(--text3); }

/* ── Detail ── */
.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text3);
  cursor: pointer; margin-bottom: 14px;
  transition: color .12s;
}
.back-link:hover { color: var(--brand); }
.detail-header {
  margin-bottom: 18px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.detail-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.detail-header h2 { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.detail-header .actions { display: flex; gap: 8px; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}
.d-field label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text3);
  display: block; margin-bottom: 4px;
}
.d-field span { font-size: 13px; color: var(--text); }
.d-field select {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 12px;
  padding: 4px 8px; outline: none; cursor: pointer;
}
.detail-desc {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 18px;
  line-height: 1.75;
  color: var(--text2); font-size: 13px;
}
.detail-desc img { max-width: 100%; border-radius: 6px; margin: 6px 0; display: block; cursor: zoom-in; }
.detail-desc code { font-family: var(--mono); background: var(--bg3); padding: 2px 5px; border-radius: 3px; font-size: 12px; }
.detail-desc a { color: var(--brand); }
.detail-desc strong { color: var(--text); }

/* ── Attachments ── */
.att-section { margin-bottom: 18px; }
.att-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text3); margin-bottom: 8px;
}
.att-list { display: flex; flex-wrap: wrap; gap: 8px; }
.att-thumb {
  width: 56px; height: 56px;
  object-fit: cover; border-radius: 5px;
  cursor: zoom-in;
  border: 1px solid var(--border);
  transition: border-color .12s;
}
.att-thumb:hover { border-color: var(--brand); }
.att-file {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 12px;
  font-size: 12px; color: var(--text2);
  text-decoration: none;
  display: flex; align-items: center; gap: 6px;
  transition: border-color .12s, color .12s;
}
.att-file:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* ── Comments ── */
.comments-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text3); margin-bottom: 10px;
}
.comment {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  margin-bottom: 8px;
}
.comment-hdr { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-author { font-size: 12px; font-weight: 600; }
.comment-date { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.comment-body { font-size: 13px; color: var(--text2); line-height: 1.65; }
.comment-body img { max-width: 100%; border-radius: 6px; margin: 6px 0; display: block; cursor: zoom-in; }
.comment-form {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-top: 14px;
}
.comment-form-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text3); margin-bottom: 10px;
}

/* ── Dropzone ── */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  color: var(--text3);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-top: 6px;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--brand);
  background: rgba(79,142,247,.04);
  color: var(--text2);
}
.pending-files { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.pfile {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px;
  font-size: 11px;
  display: flex; align-items: center; gap: 6px;
  color: var(--text2);
}
.pfile-thumb { width: 26px; height: 26px; object-fit: cover; border-radius: 3px; }
.rm-pf {
  cursor: pointer; color: var(--text3);
  font-size: 15px; line-height: 1;
  transition: color .12s;
}
.rm-pf:hover { color: var(--red); }

/* ── Form ── */
.form-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.form-card h2 { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ── Modo nav (sidebar) ── */
.mode-toggle { display: flex; gap: 4px; margin-bottom: 10px; }
.mode-toggle button {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); border-radius: 6px; padding: 7px 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: all .12s;
}
.mode-toggle button:hover { color: var(--text); border-color: var(--text3); }
.mode-toggle button.on { color: var(--brand); border-color: var(--brand); background: rgba(79,142,247,.1); }

/* ── Badges de versão / origem ── */
.vs-wait { background: rgba(100,116,139,.13); color: #7c8699; }
.vs-dev  { background: rgba(85,95,112,.2);    color: #8b95a8; }
.vs-qa   { background: rgba(250,204,21,.13);  color: var(--yellow); }
.vs-test { background: rgba(251,146,60,.15);  color: var(--orange); }
.vs-ok   { background: rgba(74,222,128,.13);  color: var(--green); }
.vs-pub  { background: rgba(79,142,247,.13);  color: var(--brand); }
.o-qa    { background: rgba(167,139,250,.18); color: var(--purple); }

/* ── Detalhe da versão ── */
.vgroup { margin-bottom: 16px; }
.vgroup-hdr {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 7px; font-size: 12px; color: var(--text3);
}
.vgroup-hdr span { font-family: var(--mono); }
.roteiro-ta {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text);
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  padding: 10px 12px; outline: none; resize: vertical;
}
.roteiro-ta:focus { border-color: var(--brand); }
.vlink { color: var(--brand); cursor: pointer; }
.vlink:hover { text-decoration: underline; }
.d-field input {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 12px;
  padding: 4px 8px; outline: none; width: 100%;
}
.d-field input:focus { border-color: var(--brand); }

/* ── Achados de QA (pm_findings) ── */
.fs-aberto    { background: rgba(251,146,60,.15);  color: var(--orange); }
.fs-resolvido { background: rgba(74,222,128,.13);  color: var(--green); }
.finding-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: 7px; padding: 10px 12px;
}
.finding-card.fs-done { opacity: .6; border-left-color: var(--green); }
.finding-main { flex: 1; cursor: pointer; min-width: 0; }
.finding-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.finding-actions .btn-ghost,
.finding-actions .btn-danger { padding: 3px 10px; font-size: 11px; }

/* ── Notificações (sininho) ── */
.notif-bell { position: relative; background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px 8px; line-height: 1; color: var(--text2, #aaa); }
.notif-badge { position: absolute; top: -2px; right: 0; background: #ef4444; color: #fff; font-size: 10px; min-width: 15px; height: 15px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; font-weight: 600; }
/* [hidden] perde pro display:flex acima; esta regra (mais especifica) garante ocultar no 0 */
.notif-badge[hidden] { display: none; }
#notif-panel { position: fixed; z-index: 1000; width: 340px; max-height: 70vh; overflow-y: auto; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.notif-hdr { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; position: sticky; top: 0; background: var(--bg2); }
.notif-readall { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 11px; }
.notif-list { display: flex; flex-direction: column; }
.notif-item { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: rgba(255,255,255,.03); }
.notif-item.unread { background: rgba(79,142,247,.07); }
.notif-title { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.notif-body { font-size: 11px; color: var(--text3); line-height: 1.45; }
.notif-time { font-size: 10px; color: var(--text3); margin-top: 5px; }
.notif-empty { padding: 22px; text-align: center; color: var(--text3); font-size: 12px; }
