* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #f8f9fa;
  color: #222;
}

/* ── Login ── */
.login-wrap {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  padding: 32px 36px;
  width: 320px;
}
.login-card h1 { font-size: 20px; margin: 0 0 18px; color: #1a1a2e; }
.login-card label { display: block; font-size: 12px; color: #555; margin: 10px 0 4px; }
.login-card input {
  width: 100%; padding: 8px 10px; border: 1px solid #ced4da;
  border-radius: 4px; font-size: 14px;
}
.login-card button {
  margin-top: 18px; width: 100%; padding: 10px; border: none;
  border-radius: 4px; background: #1a1a2e; color: white;
  font-weight: bold; cursor: pointer;
}
.login-card button:hover { background: #2d2d4e; }
.error { color: #e74c3c; font-size: 13px; margin: 0 0 10px; }

/* ── Topbar ── */
.topbar {
  background: #1a1a2e; color: white; height: 56px;
  display: flex; align-items: center; padding: 0 20px;
}
.topbar .brand { font-size: 18px; font-weight: bold; }
.topbar .spacer { flex: 1; }
.topbar .user { font-size: 13px; margin-right: 14px; opacity: .85; }
.topbar form.inline { display: inline; }
.topbar .ghost {
  background: #2d2d4e; color: white; border: none;
  padding: 6px 14px; border-radius: 4px; cursor: pointer;
}

/* ── Main ── */
main { max-width: 900px; margin: 0 auto; padding: 24px 20px; }
h2 { color: #1a1a2e; }

.new-line-form { display: flex; gap: 8px; margin-bottom: 18px; }
.new-line-form input {
  flex: 1; padding: 8px 10px; border: 1px solid #ced4da; border-radius: 4px;
}
.new-line-form button {
  padding: 8px 16px; border: none; border-radius: 4px;
  background: #1a1a2e; color: white; cursor: pointer;
}
.new-line-form button:hover { background: #2d2d4e; }

table { width: 100%; border-collapse: collapse; background: white; border-radius: 6px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
th { background: #f8f9fa; color: #495057; font-weight: bold; border-bottom: 2px solid #dee2e6; }
.empty { color: #aaa; text-align: center; }
.status { padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #eee; }
.status-connected { background: #d4edda; color: #2ecc71; }
.status-disconnected { background: #f8d7da; color: #e74c3c; }
.status-running { background: #fdebd0; color: #e67e22; }
.status-completed { background: #d4edda; color: #27ae60; }
.status-paused { background: #eee; color: #888; }
.status-pending { background: #d6eaf8; color: #2980b9; }
.status-failed { background: #f8d7da; color: #e74c3c; }
.status-sent { background: #d4edda; color: #2ecc71; }
.status-warmup { background: #d6eaf8; color: #2980b9; }

/* ── Nav ── */
.topbar .nav { display: flex; gap: 4px; margin-left: 28px; }
.topbar .nav a {
  color: #c8c8d8; text-decoration: none; font-size: 14px;
  padding: 6px 12px; border-radius: 4px;
}
.topbar .nav a:hover { background: #2d2d4e; color: white; }
.topbar .nav a.active { background: #2d2d4e; color: white; font-weight: bold; }

main.wide { max-width: 1180px; }

/* ── Cards / layout ── */
.cols { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.col { flex: 1; min-width: 320px; }
.card {
  background: white; border-radius: 6px; padding: 16px 18px; margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.card h3 { margin: 0 0 12px; font-size: 14px; color: #1a1a2e; }
.card .hint { color: #888; font-size: 11px; margin: 0 0 10px; }

/* ── Forms genéricos ── */
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 7px 9px; border: 1px solid #ced4da; border-radius: 4px; font-size: 13px;
}
.field textarea { resize: vertical; }
.row-inline { display: flex; gap: 10px; }
.row-inline .field { flex: 1; }

.checklist { max-height: 160px; overflow-y: auto; border: 1px solid #eee; border-radius: 4px; padding: 6px 10px; }
.checklist label { display: block; font-size: 13px; padding: 3px 0; cursor: pointer; }
.checklist .age { color: #aaa; font-size: 11px; }

/* ── Botones ── */
.btn {
  border: none; border-radius: 4px; padding: 8px 16px; cursor: pointer;
  font-weight: bold; font-size: 13px; color: white;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: #1a1a2e; }
.btn-primary:hover:not(:disabled) { background: #2d2d4e; }
.btn-success { background: #27ae60; }
.btn-success:hover:not(:disabled) { background: #219150; }
.btn-warning { background: #e67e22; }
.btn-warning:hover:not(:disabled) { background: #ca6c1a; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover:not(:disabled) { background: #c8392b; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

/* ── Progreso ── */
.progress-wrap { background: #eee; border-radius: 10px; height: 18px; overflow: hidden; margin: 8px 0; }
.progress-bar-fill {
  background: #27ae60; height: 100%; width: 0%; transition: width .3s;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11px; white-space: nowrap;
}

/* ── Log en vivo ── */
.log-box {
  background: #1a1a2e; color: #cfd8dc; font-family: "Consolas", monospace; font-size: 12px;
  border-radius: 6px; padding: 10px 12px; height: 260px; overflow-y: auto; white-space: pre-wrap;
}
.log-box .ln-status { color: #f4d03f; }
.log-box .ln-finished { color: #5dade2; }

/* ── Listado campañas/planes ── */
.list-actions { display: flex; gap: 6px; }
.link-btn {
  background: none; border: 1px solid #ced4da; border-radius: 4px; padding: 4px 10px;
  font-size: 12px; cursor: pointer; color: #1a1a2e; text-decoration: none; display: inline-block;
}
.link-btn:hover { background: #f0f0f0; }

/* ── Admin: roles ── */
.role-badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: bold; }
.role-admin { background: #d4c5f9; color: #6c3fc5; }
.role-user { background: #eee; color: #888; }

/* ── Admin: edición inline en la tabla de usuarios ── */
.inline-input {
  width: 100%; min-width: 90px; padding: 5px 7px; border: 1px solid #ced4da;
  border-radius: 4px; font-size: 12px;
}

/* ── Líneas: panel de QR ── */
.qr-panel:empty { padding: 0; }
.qr-panel { padding: 14px 0 6px; text-align: center; }
.qr-box img {
  border: 1px solid #ddd; border-radius: 8px; background: white; padding: 6px;
}
.qr-box .hint { color: #888; font-size: 12px; margin: 8px 0 0; }
.qr-ok { color: #27ae60; font-weight: bold; margin: 6px 0; }
