:root {
  --rojo: #e5484d;
  --amarillo: #f5a623;
  --verde: #3dbf6c;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7684;
  --border: #e1e5ea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  background: #20324a;
  color: white;
  padding: 18px 24px;
}

header h1 { margin: 0; font-size: 20px; }
header p { margin: 4px 0 0; color: #c3cedd; font-size: 13px; }

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #c3cedd;
}
.user-box a, .user-box button {
  color: white;
  background: rgba(255,255,255,0.12);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.user-box a:hover, .user-box button:hover { background: rgba(255,255,255,0.22); }

main {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
}

@media (max-width: 860px) {
  main { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.card h2 { margin-top: 0; font-size: 16px; }

label { display: block; font-size: 13px; margin: 10px 0 4px; color: var(--muted); }
input, textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 70px; }

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
}
.btn-primary { background: #2563eb; color: white; margin-top: 14px; width: 100%; }
.btn-secondary { background: #eef2f7; color: #20324a; }

.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters select { width: auto; }

.issue-list { display: flex; flex-direction: column; gap: 10px; }

.issue-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  background: #fff;
}
.issue-row:hover { border-color: #b7c3d1; }

.semaforo {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.semaforo.rojo { background: var(--rojo); }
.semaforo.amarillo { background: var(--amarillo); }
.semaforo.verde { background: var(--verde); }

.issue-main { flex: 1; }
.issue-title { font-weight: 600; margin-bottom: 2px; }
.issue-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #eef2f7;
  color: #20324a;
}
.badge.estado-cerrado { background: #e3f6e9; color: #1b6e3c; }
.badge.estado-en_progreso { background: #fef3e2; color: #92610d; }
.badge.estado-abierto { background: #e8eefc; color: #1d4ed8; }

#detail { display: none; }
#detail.active { display: block; }

.seguimiento-item {
  border-left: 3px solid #2563eb;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: #f8fafc;
  border-radius: 0 6px 6px 0;
}
.seguimiento-item .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.evidencia-link { display: inline-block; font-size: 12px; margin-right: 8px; margin-top: 4px; }

.close-btn { float: right; background: none; color: var(--muted); font-size: 18px; }

.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: #1f2933; color: white; padding: 10px 16px;
  border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
