/* ============================================
   PROYECTO FERSA — Git Version Control Theme
   ============================================ */

/* === CSS Custom Properties === */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2128;
  --bg-card: #1c2128;
  --bg-diff: #161b22;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-link: #58a6ff;

  --green-add: #3fb950;
  --green-add-bg: rgba(46, 160, 67, 0.15);
  --green-add-line: rgba(46, 160, 67, 0.3);

  --red-del: #f85149;
  --red-del-bg: rgba(248, 81, 73, 0.15);
  --red-del-line: rgba(248, 81, 73, 0.3);

  --yellow-warn: #d29922;
  --purple-merge: #bc8cff;
  --cyan-info: #39d2c0;
  --orange-accent: #f0883e;

  --border-default: #30363d;
  --border-muted: #21262d;

  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-card: 0 3px 12px rgba(0, 0, 0, 0.4);
  --shadow-glow-green: 0 0 20px rgba(63, 185, 80, 0.15);
  --shadow-glow-red: 0 0 20px rgba(248, 81, 73, 0.15);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #79c0ff;
  text-decoration: underline;
}

/* === Navbar === */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(22, 27, 34, 0.85);
}

.navbar .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-brand:hover {
  color: var(--green-add);
  text-decoration: none;
}

.navbar-brand .branch-icon {
  color: var(--green-add);
  font-size: 1.4rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* === Container === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Hero Section === */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(63, 185, 80, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green-add-bg);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--green-add);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  background: linear-gradient(
    135deg,
    var(--text-primary) 0%,
    var(--green-add) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 2rem;
  animation: fadeInUp 1s ease;
}

.hero-terminal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  max-width: 700px;
  margin: 2.5rem auto 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 1.2s ease;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-default);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red {
  background: #ff5f57;
}
.terminal-dot.yellow {
  background: #febc2e;
}
.terminal-dot.green {
  background: #28c840;
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.terminal-body {
  padding: 1.2rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
}

.terminal-line {
  opacity: 0;
  animation: typeIn 0.4s ease forwards;
}

.terminal-line:nth-child(1) {
  animation-delay: 0.3s;
}
.terminal-line:nth-child(2) {
  animation-delay: 0.7s;
}
.terminal-line:nth-child(3) {
  animation-delay: 1.1s;
}
.terminal-line:nth-child(4) {
  animation-delay: 1.5s;
}
.terminal-line:nth-child(5) {
  animation-delay: 1.9s;
}
.terminal-line:nth-child(6) {
  animation-delay: 2.3s;
}
.terminal-line:nth-child(7) {
  animation-delay: 2.7s;
}

.terminal-line .prompt {
  color: var(--cyan-info);
}

.terminal-line .cmd {
  color: var(--text-primary);
}

.terminal-line .output {
  color: var(--text-muted);
}

.terminal-line .added {
  color: var(--green-add);
}

.terminal-line .deleted {
  color: var(--red-del);
}

.terminal-line .file {
  color: var(--yellow-warn);
}

/* === Diff Showcase Section === */
.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* === Diff Block === */
.diff-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.diff-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.diff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.diff-filename {
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.diff-stats {
  display: flex;
  gap: 0.75rem;
}

.diff-stats .additions {
  color: var(--green-add);
}

.diff-stats .deletions {
  color: var(--red-del);
}

.diff-body {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
}

.diff-line {
  display: flex;
  padding: 0 1rem;
  border-left: 3px solid transparent;
  transition: background 0.15s ease;
}

.diff-line:hover {
  background: rgba(255, 255, 255, 0.03);
}

.diff-line.added {
  background: var(--green-add-bg);
  border-left-color: var(--green-add);
}

.diff-line.added:hover {
  background: var(--green-add-line);
}

.diff-line.deleted {
  background: var(--red-del-bg);
  border-left-color: var(--red-del);
}

.diff-line.deleted:hover {
  background: var(--red-del-line);
}

.diff-line.context {
  color: var(--text-muted);
}

.diff-line.hunk-header {
  background: rgba(56, 139, 253, 0.1);
  color: var(--text-link);
  font-style: italic;
  padding: 0.3rem 1rem;
}

.line-number {
  color: var(--text-muted);
  min-width: 3.5rem;
  text-align: right;
  padding-right: 1rem;
  user-select: none;
  opacity: 0.5;
}

.line-content {
  flex: 1;
  white-space: pre-wrap;
}

.line-prefix {
  min-width: 1.2rem;
  user-select: none;
}

.line-prefix.add-prefix {
  color: var(--green-add);
}

.line-prefix.del-prefix {
  color: var(--red-del);
}

/* === Commit Timeline === */
.commit-timeline {
  position: relative;
  padding-left: 2rem;
}

.commit-timeline::before {
  content: "";
  position: absolute;
  left: 0.7rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-default);
}

.commit-item {
  position: relative;
  padding: 1rem 0 1.5rem 1.5rem;
  animation: fadeInLeft 0.5s ease;
}

.commit-item::before {
  content: "";
  position: absolute;
  left: -1.65rem;
  top: 1.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green-add);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--bg-primary);
  z-index: 1;
}

.commit-item:nth-child(2)::before {
  background: var(--purple-merge);
}
.commit-item:nth-child(3)::before {
  background: var(--cyan-info);
}
.commit-item:nth-child(4)::before {
  background: var(--orange-accent);
}
.commit-item:nth-child(5)::before {
  background: var(--yellow-warn);
}

.commit-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.commit-card:hover {
  border-color: var(--green-add);
  box-shadow: var(--shadow-glow-green);
}

.commit-hash {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-link);
  margin-bottom: 0.3rem;
}

.commit-message {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.commit-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.commit-meta .tag {
  background: rgba(188, 140, 255, 0.15);
  color: var(--purple-merge);
  padding: 0.15rem 0.6rem;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* === Resource Cards Grid === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.resource-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.resource-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-add), var(--cyan-info));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.resource-card:hover {
  transform: translateY(-4px);
  border-color: var(--green-add);
  box-shadow: var(--shadow-glow-green);
}

.resource-card:hover::before {
  opacity: 1;
}

.resource-card .card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.resource-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.resource-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.resource-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--green-add);
  font-weight: 600;
  transition: gap 0.2s ease;
}

.resource-card:hover .card-link {
  gap: 0.7rem;
}

/* === Tools Grid === */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan-info);
}

.tool-card .tool-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.tool-card h4 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.tool-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.tool-card a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-link);
}

/* === Branch Visualization === */
.branch-visual {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.branch-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid;
  transition: transform 0.2s ease;
}

.branch-tag:hover {
  transform: scale(1.05);
}

.branch-tag.main {
  background: rgba(63, 185, 80, 0.12);
  border-color: rgba(63, 185, 80, 0.35);
  color: var(--green-add);
}

.branch-tag.develop {
  background: rgba(188, 140, 255, 0.12);
  border-color: rgba(188, 140, 255, 0.35);
  color: var(--purple-merge);
}

.branch-tag.feature {
  background: rgba(57, 210, 192, 0.12);
  border-color: rgba(57, 210, 192, 0.35);
  color: var(--cyan-info);
}

.branch-tag.hotfix {
  background: rgba(248, 81, 73, 0.12);
  border-color: rgba(248, 81, 73, 0.35);
  color: var(--red-del);
}

/* === Footer === */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-default);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
}

.footer-commit {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

.footer-commit .hash {
  color: var(--text-link);
}

.footer-commit .author {
  color: var(--green-add);
}

.footer-commit .message {
  color: var(--yellow-warn);
}

/* === Animations === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes typeIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.cursor-blink {
  animation: pulse 1s ease infinite;
  color: var(--green-add);
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════
   MODAL DE AUTENTICACIÓN
═══════════════════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(1, 4, 9, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: fadeInUp 0.3s ease;
}

.modal-logo {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.modal-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.modal-card > p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.modal-steps {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 2.2;
}

.modal-steps code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--cyan-info);
  font-size: 0.78rem;
}

.modal-input-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.token-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.6rem 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
  min-width: 0;
}

.token-input:focus {
  border-color: var(--green-add);
}

.btn-primary {
  background: var(--green-add);
  color: #0d1117;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.token-error {
  font-size: 0.82rem;
  color: var(--red-del);
  padding: 0.5rem 0;
  line-height: 1.5;
}

.token-ok {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--green-add-bg);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.ok-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--green-add);
  flex-shrink: 0;
}

.ok-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.ok-login {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--green-add);
}

.modal-footer {
  margin-top: 1.25rem;
  text-align: right;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--green-add);
  color: var(--green-add);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-secondary:hover {
  background: var(--green-add-bg);
}

/* ═══════════════════════════════════════════════════════
   NAVBAR — TOKEN BUTTON
═══════════════════════════════════════════════════════ */
.nav-token-btn {
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  padding: 0.25rem 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.nav-token-btn:hover {
  border-color: var(--green-add);
  color: var(--text-primary);
}

.nav-token-btn.is-connected {
  border-color: var(--green-add);
  color: var(--green-add);
  background: var(--green-add-bg);
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD EN VIVO
═══════════════════════════════════════════════════════ */
.dashboard-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  min-width: 120px;
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--green-add);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

/* ── Branch card ──────────────────────── */
.branch-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.branch-card:hover {
  box-shadow: var(--shadow-card);
}

.bc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.bc-name {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Status badges ────────────────────── */
.b-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.b-status.loading {
  color: var(--text-muted);
  background: var(--bg-tertiary);
}

.b-status.ahead {
  color: var(--green-add);
  background: var(--green-add-bg);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.b-status.behind {
  color: var(--orange-accent);
  background: rgba(240, 136, 62, 0.12);
  border: 1px solid rgba(240, 136, 62, 0.3);
}

.b-status.synced {
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-muted);
}

.b-status.diverged {
  color: var(--yellow-warn);
  background: rgba(210, 153, 34, 0.12);
  border: 1px solid rgba(210, 153, 34, 0.3);
}

/* ── Commit row ───────────────────────── */
.bc-commit {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  min-width: 0;
}

.bc-hash {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-link);
  flex-shrink: 0;
}

.bc-msg {
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bc-msg.muted {
  color: var(--text-muted);
  font-style: italic;
}

.bc-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.bc-files {
  color: var(--cyan-info);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* ── Expand button ────────────────────── */
.btn-expand {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-expand:hover {
  background: var(--green-add-bg);
  border-color: var(--green-add);
  color: var(--green-add);
}

/* ── Detail panel (expandible) ────────── */
.branch-detail {
  margin-top: 1rem;
  border-top: 1px solid var(--border-muted);
  padding-top: 1rem;
}

.detail-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
}

.detail-commits {
  margin-bottom: 0.5rem;
}

.detail-title:first-child,
.detail-commits .detail-title {
  margin-top: 0;
}

.detail-commit {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-muted);
  font-size: 0.82rem;
}

.detail-commit:last-child {
  border-bottom: none;
}

.detail-hash {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-link);
  flex-shrink: 0;
}

.detail-hash:hover {
  color: #79c0ff;
}

.detail-msg {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.detail-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.detail-empty {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 0.5rem 0;
}

/* ── Dashboard utilities ──────────────── */
.db-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.db-message.error {
  color: var(--red-del);
}

.dashboard-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-refresh {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh:hover:not(:disabled) {
  border-color: var(--green-add);
  color: var(--green-add);
}

.btn-refresh:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.last-updated {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Label de diff en vivo ──────────────────────────── */
.diff-live-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-default);
}

/* === Responsive === */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .navbar .container {
    flex-direction: column;
    gap: 0.8rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .branch-visual {
    gap: 1rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .diff-line .line-number {
    min-width: 2.5rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .terminal-body {
    font-size: 0.75rem;
    padding: 1rem;
  }

  .section {
    padding: 2.5rem 0;
  }
}
