/* ═══════════════════════════════════════════════════════════
   MadWorks Team — Módulo GitHub (v2.1)
   ═══════════════════════════════════════════════════════════ */

.mw-gh-nav-badge {
  margin-left: auto;
  background: var(--ps-error);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  width: 8px; height: 8px;
  border-radius: 50%;
  overflow: hidden;
  text-indent: -99px;
}

.mw-gh-topbar { justify-content: space-between; align-items: center; }
.mw-gh-sync { display: flex; align-items: center; gap: 10px; }
.mw-gh-sync-label { font-size: 12px; color: var(--ps-on-surface-variant); }
.mw-gh-spin { animation: mwGhSpin 1s linear infinite; }
@keyframes mwGhSpin { to { transform: rotate(360deg); } }

.mw-gh-notice {
  padding: 12px 16px;
  border-radius: var(--ps-radius);
  font-size: 13px;
  line-height: 1.5;
}
.mw-gh-notice code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
.mw-gh-notice a { color: var(--ps-primary); font-weight: 600; }
.mw-gh-notice--info  { background: var(--ps-primary-fixed); color: var(--ps-on-primary-fixed); }
.mw-gh-notice--error { background: var(--ps-error-container); color: #410002; white-space: pre-line; }

.mw-gh-tabs { margin-top: -12px; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap !important; scrollbar-width: none; }
.mw-gh-tabs::-webkit-scrollbar { display: none; }
#screen-github { min-width: 0; }
.mw-gh-pane { display: none; }
.mw-gh-pane.active { display: block; }

/* Layout actividad */
.mw-gh-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.mw-gh-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.mw-gh-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.mw-gh-filters .mw-select { width: auto !important; min-width: 150px; }

.mw-gh-card {
  background: var(--ps-surface-container-lowest);
  border: 1px solid var(--mw-border-light);
  border-radius: var(--ps-radius-lg);
  padding: 16px;
}
.mw-gh-card-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ps-on-surface-variant);
  margin-bottom: 10px;
}
.mw-gh-card-title .material-symbols-outlined { font-size: 18px; }
.mw-gh-hint { font-size: 12px; color: var(--ps-on-surface-variant); margin: 4px 0 8px; line-height: 1.5; }
.mw-gh-status-row { display: flex; gap: 6px; margin-top: 8px; }
.mw-gh-status-row .mw-select { flex: 1; min-width: 0; }

.mw-gh-empty { padding: 32px 16px; text-align: center; color: var(--ps-on-surface-variant); font-size: 13px; }
.mw-gh-empty--sm { padding: 12px 0; }
.mw-gh-more { text-align: center; margin-top: 12px; }

/* Feed */
.mw-gh-feed { display: flex; flex-direction: column; }
.mw-gh-day {
  font-size: 12px; font-weight: 700; color: var(--ps-on-surface-variant);
  text-transform: capitalize; margin: 18px 0 8px;
}
.mw-gh-day:first-child { margin-top: 4px; }
.mw-gh-item {
  display: flex; gap: 12px;
  position: relative;
  padding-bottom: 14px;
}
.mw-gh-item::before { /* línea de tiempo */
  content: ''; position: absolute; left: 15px; top: 32px; bottom: 0;
  width: 2px; background: var(--mw-border-light);
}
.mw-gh-item-icon {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ps-surface-container); color: var(--ps-on-surface-variant);
  position: relative; z-index: 1;
}
.mw-gh-item-icon .material-symbols-outlined { font-size: 18px; }
.mw-gh-item--push   .mw-gh-item-icon { background: var(--ps-primary-fixed); color: var(--ps-primary); }
.mw-gh-item--merged .mw-gh-item-icon { background: #ede9fe; color: #7c3aed; }
.mw-gh-item--pr     .mw-gh-item-icon { background: #dcfce7; color: #15803d; }
.mw-gh-item--review .mw-gh-item-icon { background: #fef3c7; color: #b45309; }
.mw-gh-item--request .mw-gh-item-icon { background: #ffedd5; color: #c2410c; }
.mw-gh-item--closed .mw-gh-item-icon { background: var(--ps-error-container); color: var(--ps-error); }
.mw-gh-item--branch .mw-gh-item-icon { background: #e0f2fe; color: #0369a1; }

.mw-gh-item-main {
  flex: 1; min-width: 0;
  background: var(--ps-surface-container-lowest);
  border: 1px solid var(--mw-border-light);
  border-radius: var(--ps-radius-lg);
  padding: 10px 14px;
}
.mw-gh-item-head { display: flex; align-items: center; gap: 10px; }
.mw-gh-item-text { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ps-on-surface); line-height: 1.45; }
.mw-gh-item-right { display: flex; align-items: center; gap: 8px; font-size: 12px; white-space: nowrap; }
.mw-gh-avatar { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.mw-gh-avatar--ph {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ps-surface-container-high); color: var(--ps-on-surface-variant);
  font-size: 12px; font-weight: 700;
}
.mw-gh-time { color: var(--ps-outline); font-size: 12px; font-variant-numeric: tabular-nums; }
.mw-gh-branch {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; background: #e0f2fe; color: #075985;
  padding: 1px 6px; border-radius: 4px; white-space: nowrap;
}
.mw-gh-repo {
  font-size: 11px; color: var(--ps-on-surface-variant);
  border: 1px solid var(--ps-outline-variant); padding: 0 6px; border-radius: 99px; white-space: nowrap;
}
.mw-gh-add { color: #15803d; font-weight: 600; font-variant-numeric: tabular-nums; }
.mw-gh-del { color: #b91c1c; font-weight: 600; font-variant-numeric: tabular-nums; }
.mw-gh-ext { color: var(--ps-on-surface-variant); display: inline-flex; }
.mw-gh-ext .material-symbols-outlined { font-size: 16px; }
.mw-gh-ext:hover { color: var(--ps-primary); }
.mw-gh-sha {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; color: var(--ps-primary) !important; text-decoration: none;
}
.mw-gh-pill {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 1px 8px; border-radius: 99px;
  background: var(--ps-surface-container); color: var(--ps-on-surface-variant);
}
.mw-gh-pill--approved          { background: #dcfce7; color: #166534; }
.mw-gh-pill--changes_requested { background: var(--ps-error-container); color: #93000a; }
.mw-gh-quote {
  margin-top: 8px; padding: 8px 12px;
  border-left: 3px solid var(--ps-outline-variant);
  background: var(--ps-surface-container-low);
  border-radius: 0 6px 6px 0;
  font-size: 13px; color: var(--ps-on-surface-variant); line-height: 1.5;
  max-height: 180px; overflow: auto;
}

/* Pasos (commits) */
.mw-gh-steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mw-gh-step { border-top: 1px dashed var(--mw-border-light); padding-top: 8px; }
.mw-gh-step:first-child { border-top: 0; padding-top: 0; }
.mw-gh-step-head { display: flex; align-items: baseline; gap: 8px; }
.mw-gh-step-n {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ps-surface-container); color: var(--ps-on-surface-variant);
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.mw-gh-step-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ps-on-surface); }
.mw-gh-step-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.mw-gh-step-body { margin: 4px 0 0 28px; font-size: 12.5px; color: var(--ps-on-surface-variant); line-height: 1.5; }
.mw-gh-files { margin: 4px 0 0 28px; font-size: 12px; }
.mw-gh-files summary { cursor: pointer; color: var(--ps-on-surface-variant); }
.mw-gh-files ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mw-gh-files code { font-size: 11.5px; word-break: break-all; }
.mw-gh-fstatus { display: inline-block; min-width: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; margin-right: 4px; }
.mw-gh-fstatus--added   { color: #15803d; }
.mw-gh-fstatus--removed { color: #b91c1c; }
.mw-gh-fstatus--renamed { color: #b45309; }

/* Equipo */
.mw-gh-member { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--mw-border-light); }
.mw-gh-member:first-child { border-top: 0; padding-top: 0; }
.mw-gh-member-av { position: relative; flex-shrink: 0; }
.mw-gh-member-av img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.mw-gh-member-dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--ps-surface-container-lowest);
  background: var(--ps-outline-variant);
}
.mw-gh-member--online .mw-gh-member-dot { background: var(--ps-success); }
.mw-gh-member--away   .mw-gh-member-dot { background: var(--ps-warning); }
.mw-gh-member--offline .mw-gh-member-av img { filter: grayscale(.6); opacity: .8; }
.mw-gh-member-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mw-gh-member-name { font-size: 13.5px; font-weight: 700; color: var(--ps-on-surface); }
.mw-gh-you { font-size: 10px; font-weight: 700; color: var(--ps-primary); background: var(--ps-primary-fixed); padding: 0 5px; border-radius: 4px; vertical-align: middle; }
.mw-gh-member-presence { font-size: 12px; color: var(--ps-on-surface-variant); }
.mw-gh-member-status {
  display: flex; align-items: flex-start; gap: 4px;
  font-size: 12.5px; color: var(--ps-on-surface); background: var(--ps-surface-container-low);
  padding: 4px 8px; border-radius: 6px; margin-top: 2px;
}
.mw-gh-member-status .material-symbols-outlined { font-size: 15px; color: var(--ps-primary); }
.mw-gh-member-branch { font-size: 12px; color: var(--ps-on-surface-variant); }
.mw-gh-member-last {
  font-size: 11.5px; color: var(--ps-outline);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Resumen del día */
.mw-gh-daynav { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.mw-gh-daynav .mw-input { width: auto !important; }
#mwGhDayBody { display: flex; flex-direction: column; gap: 16px; }
.mw-gh-dayperson-head { display: flex; align-items: center; gap: 12px; }
.mw-gh-dayperson-head .mw-gh-avatar { width: 40px; height: 40px; }
.mw-gh-dayperson-actions { margin-left: auto; }
.mw-gh-ai {
  margin-top: 12px; padding: 12px 16px;
  background: linear-gradient(135deg, #f5f3ff, #eef2ff);
  border: 1px solid #ddd6fe; border-radius: var(--ps-radius);
  font-size: 13.5px; line-height: 1.6; color: var(--ps-on-surface);
}
.mw-gh-ai ul { margin: 0; padding-left: 18px; list-style: disc !important; }
.mw-gh-ai li { margin: 3px 0; }
.mw-gh-ai p { margin: 6px 0; }
.mw-gh-pending { background: #fff7ed; border-radius: 6px; padding: 6px 10px; }
.mw-gh-error { color: var(--ps-error); font-size: 13px; }
.mw-gh-steps--day { margin-top: 14px; }
.mw-gh-dayprs { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ps-on-surface-variant); }

/* Formularios */
.mw-gh-form { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.mw-gh-h3 { font-size: 15px; font-weight: 700; margin: 8px 0 -6px; color: var(--ps-on-surface); }
.mw-gh-optional { font-size: 11px; font-weight: 600; color: var(--ps-on-surface-variant); background: var(--ps-surface-container); padding: 1px 8px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.mw-gh-row { display: flex; align-items: center; gap: 10px; }
.mw-gh-narrow { max-width: 260px; }
.mw-gh-test-result { font-size: 12.5px; line-height: 1.5; }
.mw-gh-test-result.ok  { color: #15803d; }
.mw-gh-test-result.err { color: var(--ps-error); }
.mw-gh-maprow { display: grid; grid-template-columns: 1fr 220px; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--mw-border-light); font-size: 13px; }
.mw-gh-maprow small { color: var(--ps-on-surface-variant); }
.mw-gh-prefs { display: flex; flex-direction: column; gap: 8px; }
.mw-gh-prefs-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ps-on-surface-variant); margin: 8px 0 0; }
.mw-gh-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--ps-on-surface); cursor: pointer; line-height: 1.4; }
.mw-gh-check input { margin-top: 2px; accent-color: var(--ps-primary); }

@media (max-width: 1100px) {
  .mw-gh-layout { grid-template-columns: 1fr; }
  .mw-gh-side { position: static; order: -1; }
}
@media (max-width: 640px) {
  .mw-gh-item-head { flex-wrap: wrap; }
  .mw-gh-step-head { flex-wrap: wrap; }
  .mw-gh-maprow { grid-template-columns: 1fr; }
  .mw-gh-filters .mw-select { flex: 1; min-width: 0; }
}

/* Datos de conexión de la app de escritorio */
.mw-gh-desktop-creds { display: flex; flex-direction: column; gap: 6px; }
.mw-gh-cred { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.mw-gh-cred span { color: var(--ps-on-surface-variant); font-weight: 600; }
.mw-gh-cred code { background: var(--ps-surface-container-low); padding: 6px 10px; border-radius: 6px; font-size: 13px; word-break: break-all; }
